File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change 4
4
push :
5
5
branches :
6
6
- master
7
+ release :
8
+ types : [published]
7
9
8
10
jobs :
9
11
push_to_registry :
@@ -17,19 +19,29 @@ jobs:
17
19
steps :
18
20
- name : Checkout
19
21
uses : actions/checkout@v4
20
- - name : Login to GitHub Container Registry
22
+ - name : Set up QEMU
23
+ uses : docker/setup-qemu-action@v2
24
+ - name : Set up Docker Buildx
25
+ uses : docker/setup-buildx-action@v2
26
+ - name : Login to Docker Hub
21
27
uses : docker/login-action@v3
22
28
with :
23
- registry : ${{ env.REGISTRY }}
24
29
username : ${{ secrets.DOCKERHUB_USERNAME }}
25
30
password : ${{ secrets.DOCKERHUB_TOKEN }}
31
+ - name : Extract version tag
32
+ id : extract_tag
33
+ if : github.event_name == 'release'
34
+ run : echo "RELEASE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
26
35
- name : Build and push image
27
36
id : push
28
37
29
38
with :
30
39
context : .
31
40
push : true
32
- tags : sjdonado/url-shortener:latest
41
+ platforms : linux/amd64,linux/arm64
42
+ tags : |
43
+ sjdonado/url-shortener:latest
44
+ ${{ github.event_name == 'release' && 'sjdonado/url-shortener:${{ env.RELEASE_TAG }}' || '' }}
33
45
- name : Attest
34
46
uses : actions/attest-build-provenance@v1
35
47
id : attest
You can’t perform that action at this time.
0 commit comments