File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77 - ' v*.*.*'
88
99jobs :
10- build :
11- name : Build Docker image and push to repositories
10+ deploy-tagged :
11+ if : ${{ startsWith(github.ref, 'refs/tags/') }}
12+ name : Tagged release deploy
1213 runs-on : ubuntu-latest
14+ steps :
15+ - name : Checkout code
16+ uses : actions/checkout@v3
17+
18+ - name : Set Tag Variable
19+ id : vars
20+ run : echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
1321
22+ - name : Login to Dockerhub
23+ uses : docker/login-action@v2
24+ with :
25+ username : ${{ secrets.DOCKER_HUB_USERNAME }}
26+ password : ${{ secrets.DOCKER_HUB_PASSWORD }}
27+
28+ - name : Build and Push
29+ uses : docker/build-push-action@v4
30+ with :
31+ context : .
32+ push : true
33+ tags : |
34+ binarypatrick/header-audit:latest
35+ binarypatrick/header-audit:${{ steps.vars.outputs.tag }}
36+
37+ deploy-untagged :
38+ if : ${{ ! startsWith(github.ref, 'refs/tags/') }}
39+ name : Tagged release deploy
40+ runs-on : ubuntu-latest
1441 steps :
1542 - name : Checkout code
1643 uses : actions/checkout@v3
2653 password : ${{ secrets.DOCKER_HUB_PASSWORD }}
2754
2855 - name : Build and Push
29- if : ${{ ! startsWith(github.ref, 'refs/tags/') }}
3056 uses : docker/build-push-action@v4
3157 with :
3258 context : .
3359 push : true
34- tags : ${{ github.sha }}
60+ tags : binarypatrick/header-audit: ${{ github.sha }}
You can’t perform that action at this time.
0 commit comments