@@ -25,29 +25,29 @@ jobs:
2525 docker-tag : ${{ steps.vars.outputs.docker-tag }}
2626 repository-lc : ${{ steps.vars.outputs.repository-lc }}
2727 steps :
28- - name : Define variables
29- id : vars
30- run : |
31- if [[ "${{ github.event_name }}" == "push" ]]; then
32- {
33- echo "checkout-ref=main"
34- echo "docker-tag=latest"
35- } >> "$GITHUB_OUTPUT"
36- elif [[ "${{ github.event_name }}" == "pull_request" ]]; then
37- {
38- echo "checkout-ref=pr"
39- echo "docker-tag=pr-${{ github.event.pull_request.number }}"
40- } >> "$GITHUB_OUTPUT"
41- else
42- {
43- echo "checkout-ref=${INPUTS_TAG}"
44- echo "docker-tag=${INPUTS_TAG}"
45- } >> "$GITHUB_OUTPUT"
46- fi
47- echo "repository-lc=${REPOSITORY,,}" >> "$GITHUB_OUTPUT"
48- env :
49- REPOSITORY : ${{ github.repository }}
50- INPUTS_TAG : ${{ inputs.tag }}
28+ - name : Define variables
29+ id : vars
30+ run : |
31+ if [[ "${{ github.event_name }}" == "push" ]]; then
32+ {
33+ echo "checkout-ref=main"
34+ echo "docker-tag=latest"
35+ } >> "$GITHUB_OUTPUT"
36+ elif [[ "${{ github.event_name }}" == "pull_request" ]]; then
37+ {
38+ echo "checkout-ref=pr"
39+ echo "docker-tag=pr-${{ github.event.pull_request.number }}"
40+ } >> "$GITHUB_OUTPUT"
41+ else
42+ {
43+ echo "checkout-ref=${INPUTS_TAG}"
44+ echo "docker-tag=${INPUTS_TAG}"
45+ } >> "$GITHUB_OUTPUT"
46+ fi
47+ echo "repository-lc=${REPOSITORY,,}" >> "$GITHUB_OUTPUT"
48+ env :
49+ REPOSITORY : ${{ github.repository }}
50+ INPUTS_TAG : ${{ inputs.tag }}
5151
5252 build-amd64 :
5353 name : Build AMD64 Image
@@ -57,19 +57,21 @@ jobs:
5757 packages : write
5858 needs : set-context
5959 steps :
60- - uses : actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
61- if : needs.set-context.outputs.checkout-ref == 'pr'
62- with :
63- persist-credentials : false
64- - uses : actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
65- if : needs.set-context.outputs.checkout-ref != 'pr'
66- with :
67- ref : ${{ needs.set-context.outputs.checkout-ref }}
68- persist-credentials : false
69- - uses : ./.github/actions/docker-build
70- with :
71- platform : amd64
72- token : ${{ secrets.GITHUB_TOKEN }}
60+ - &checkout-step-pr
61+ uses : actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
62+ if : needs.set-context.outputs.checkout-ref == 'pr'
63+ with :
64+ persist-credentials : false
65+ - &checkout-step-ref
66+ uses : actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
67+ if : needs.set-context.outputs.checkout-ref != 'pr'
68+ with :
69+ ref : ${{ needs.set-context.outputs.checkout-ref }}
70+ persist-credentials : false
71+ - uses : ./.github/actions/docker-build
72+ with :
73+ platform : amd64
74+ token : ${{ secrets.GITHUB_TOKEN }}
7375
7476 build-arm64 :
7577 name : Build ARM64 Image
@@ -79,19 +81,12 @@ jobs:
7981 packages : write
8082 needs : set-context
8183 steps :
82- - uses : actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
83- if : needs.set-context.outputs.checkout-ref == 'pr'
84- with :
85- persist-credentials : false
86- - uses : actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
87- if : needs.set-context.outputs.checkout-ref != 'pr'
88- with :
89- ref : ${{ needs.set-context.outputs.checkout-ref }}
90- persist-credentials : false
91- - uses : ./.github/actions/docker-build
92- with :
93- platform : arm64
94- token : ${{ secrets.GITHUB_TOKEN }}
84+ - *checkout-step-pr
85+ - *checkout-step-ref
86+ - uses : ./.github/actions/docker-build
87+ with :
88+ platform : arm64
89+ token : ${{ secrets.GITHUB_TOKEN }}
9590
9691 merge :
9792 name : Create Multi-Platform Image
0 commit comments