File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Docker image
2+
3+ on :
4+ workflow_dispatch :
5+ pull_request :
6+ push :
7+ branches :
8+ - main
9+
10+ jobs :
11+ build :
12+ permissions : write-all
13+ runs-on : windows-2022
14+ steps :
15+ - uses : actions/checkout@v3
16+ - name : Generate image tag
17+ shell : bash
18+ id : gen-image-tag
19+ run : |
20+ if [ "${{ github.event_name }}" == "pull_request" ]; then
21+ ref=PR-${{ github.event.number }}
22+ # NOTE: we tag images with the head commit so they can be easily tagged/deployed,
23+ # but on pull requests the image is actually built with the merge commit
24+ head_commit=${{ github.event.pull_request.head.sha }}
25+ else
26+ ref=${{ github.ref_name }}
27+ head_commit=${{ github.sha }}
28+ fi
29+ # for PRs: PR-11850.37.e7426df
30+ # for push (develop/main/master): master.37.e7426df
31+ echo "image_tag=${ref}.${{ github.run_number }}.$(echo ${head_commit} | cut -c1-7)" >> $GITHUB_OUTPUT
32+ - uses : mr-smithers-excellent/docker-build-push@v6
33+ with :
34+ image : adf-shir
35+ tags : ${{ steps.gen-image-tag.outputs.image_tag }}
36+ registry : ghcr.io
37+ username : ${{ github.actor }}
38+ password : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments