Skip to content

Commit 6d1378a

Browse files
committed
Update CI/CD
1 parent cc22e5a commit 6d1378a

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

.github/workflows/docker.yml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ on:
55
branches: [ "master", "dev" ]
66
pull_request:
77
branches: [ "master", "dev" ]
8+
release:
9+
types: [ published ]
810

911
jobs:
1012
build:
13+
if: github.event_name != 'release'
1114
runs-on: ubuntu-latest
1215
steps:
1316
- name: Login to Docker Hub
@@ -23,4 +26,25 @@ jobs:
2326
uses: docker/build-push-action@v6
2427
with:
2528
push: true
26-
tags: ${{ secrets.DOCKERHUB_USERNAME }}/ssh-key-authority:latest-${{ vars.GITHUB_REF_NAME }}
29+
tags: ${{ secrets.DOCKERHUB_USERNAME }}/ssh-key-authority:latest-${{ github.ref_name }}
30+
31+
release:
32+
if: github.event_name == 'release'
33+
runs-on: ubuntu-latest
34+
steps:
35+
- name: Login to Docker Hub
36+
uses: docker/login-action@v3
37+
with:
38+
username: ${{ secrets.DOCKERHUB_USERNAME }}
39+
password: ${{ secrets.DOCKERHUB_TOKEN }}
40+
41+
- name: Set up Docker Buildx
42+
uses: docker/setup-buildx-action@v3
43+
44+
- name: Build and push release image
45+
uses: docker/build-push-action@v6
46+
with:
47+
push: true
48+
tags: |
49+
${{ secrets.DOCKERHUB_USERNAME }}/ssh-key-authority:${{ github.event.release.tag_name }}
50+
${{ secrets.DOCKERHUB_USERNAME }}/ssh-key-authority:latest

0 commit comments

Comments
 (0)