11name : docker-publish
2-
32on :
43 workflow_call :
54 inputs :
1312 extra_build_args :
1413 required : false
1514 type : string
16-
15+ concurrency :
16+ group : docker-publish-${{ inputs.toolname }}-${{ github.ref }}
17+ cancel-in-progress : true
1718jobs :
1819 docker :
1920 runs-on : ${{ matrix.os }}
2021 outputs :
2122 branch : ${{ steps.extract_branch.outputs.branch }}
2223 permissions :
23- actions : write
2424 packages : write
2525 contents : read
2626 security-events : write
@@ -35,46 +35,32 @@ jobs:
3535 arch : arm64
3636 platform : linux/arm64
3737 steps :
38- -
39- name : Cancel previous run in progress
40- uses : styfle/cancel-workflow-action@d07a454dad7609a92316b57b23c9ccfd4f59af66
41- with :
42- ignore_sha : true
43- all_but_latest : true
44- access_token : ${{ secrets.GITHUB_TOKEN }}
45- -
46- name : Checkout
38+ - name : Checkout
4739 uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
48- -
49- name : Generate build timestamp
40+ - name : Generate build timestamp
5041 shell : bash
5142 run : echo "btimestamp=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
5243 id : generate_build_timestamp
53- -
54- name : Extract branch name
44+ - name : Extract branch name
5545 shell : bash
5646 run : echo "branch=$(echo ${GITHUB_REF#refs/heads/})" | sed "s/-build$//" >> $GITHUB_OUTPUT
5747 id : extract_branch
58- -
59- name : Extract commit SHA
48+ - name : Extract commit SHA
6049 shell : bash
6150 run : echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
6251 id : extract_commit_sha
63- -
64- name : Set up Docker Buildx
52+ - name : Set up Docker Buildx
6553 uses : docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd
6654 with :
6755 driver-opts : |
6856 image=moby/buildkit:master
69- -
70- name : Log in to registry
57+ - name : Log in to registry
7158 uses : docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121
7259 with :
7360 registry : ghcr.io
7461 username : ${{ github.repository_owner }}
7562 password : ${{ secrets.GITHUB_TOKEN }}
76- -
77- name : Build and push
63+ - name : Build and push
7864 uses : docker/build-push-action@bcafcacb16a39f128d818304e6c9c0c18556b85f
7965 with :
8066 context : .
0 commit comments