@@ -90,16 +90,25 @@ jobs:
9090
9191 steps :
9292 - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
93+ - name : Skip the build on the platform if `.skip-${{ matrix.arch }}` exists in ${{ matrix.image }}
94+ id : skip_check
95+ run : |
96+ if test -f "./${{ matrix.image }}/.skip-${{ matrix.arch }}"; then
97+ echo DO_NOT_BUILD=true >> "$GITHUB_OUTPUT"
98+ fi
9399 # - uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
94100 - uses : docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
101+ if : steps.skip_check.outputs.DO_NOT_BUILD != 'true'
95102 - name : Log in to the Github Container registry
103+ if : steps.skip_check.outputs.DO_NOT_BUILD != 'true'
96104 uses : docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
97105 with :
98106 registry : ghcr.io
99107 username : ${{ github.actor }}
100108 password : ${{ secrets.GITHUB_TOKEN }}
101109
102110 - uses : docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5.7.0
111+ if : steps.skip_check.outputs.DO_NOT_BUILD != 'true'
103112 id : meta
104113 with :
105114 images : ghcr.io/offbyone/${{ matrix.image }}
@@ -112,6 +121,7 @@ jobs:
112121 type=ref,event=pr
113122
114123 - name : Build and push by digest
124+ if : steps.skip_check.outputs.DO_NOT_BUILD != 'true'
115125 id : build
116126 uses : docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
117127 with :
@@ -121,19 +131,30 @@ jobs:
121131 outputs : type=image,name=ghcr.io/offbyone/${{ matrix.image }},push-by-digest=true,name-canonical=true,push=true
122132
123133 - name : Export digest
134+ if : steps.skip_check.outputs.DO_NOT_BUILD != 'true'
124135 run : |
125136 mkdir -p /tmp/digests-${{ matrix.image }}
126137 digest="${{ steps.build.outputs.digest }}"
127138 touch "/tmp/digests-${{ matrix.image }}/${digest#sha256:}"
128139
129140 - name : Upload digest
141+ if : steps.skip_check.outputs.DO_NOT_BUILD != 'true'
130142 uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
131143 with :
132144 name : digests-${{ matrix.image }}-${{ matrix.arch }}
133145 path : /tmp/digests-${{ matrix.image }}/*
134146 if-no-files-found : error
135147 retention-days : 1
136148
149+ check :
150+ runs-on : ubuntu-latest
151+ name : Check builds
152+ needs :
153+ - build
154+ steps :
155+ - name : no-op
156+ run : exit 0
157+
137158 merge :
138159 runs-on : ubuntu-latest
139160 name : Merge the builds for ${{ matrix.image }}
0 commit comments