-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (37 loc) · 1.18 KB
/
publish.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Publish
on:
workflow_dispatch:
jobs:
publish_onchain-non-merklized-issuer-demo:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Determine tag
id: tag
run: |
ref=$(echo ${{ github.ref }} | cut -d'/' -f3)
echo "Original ref: $ref"
if [[ "$ref" == "master" ]]; then
echo "::set-output name=tag::latest"
elif [[ "$ref" == "develop" ]]; then
echo "::set-output name=tag::develop"
else
echo "::set-output name=tag::$ref"
fi
- name: Build and Deploy to ghcr.io
run: |
tag=${{ steps.tag.outputs.tag }}
echo "Using tag: $tag"
docker buildx build -f build/Dockerfile --push \
--platform linux/amd64,linux/arm64 \
-t ghcr.io/${{ github.repository }}:${tag} .