Skip building with tags

This commit is contained in:
Felipe Knorr Kuhn 2025-11-28 22:04:45 -08:00
parent 1205d15920
commit f3311382e4
No known key found for this signature in database
GPG key ID: 79619B52BB097C1A

View file

@ -141,39 +141,21 @@ jobs:
- name: Run Docker buildx for ${{ matrix.service }} against tag
id: docker-build
# Skip building/pushing images when this is a docker-test label PR
if: |
github.event_name == 'push' ||
(github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'docker-test'))
run: |
# For docker-test label PRs, build locally without pushing
IS_DOCKER_TEST=false
if [ "${{ github.event_name }}" = "pull_request" ]; then
LABELS="${{ join(github.event.pull_request.labels.*.name, ' ') }}"
if echo "$LABELS" | grep -q "docker-test"; then
IS_DOCKER_TEST=true
fi
fi
if [ "$IS_DOCKER_TEST" = "true" ]; then
docker buildx build \
--cache-from "type=local,src=/tmp/.buildx-cache" \
--cache-to "type=local,dest=/tmp/.buildx-cache,mode=max" \
--platform linux/amd64,linux/arm64 \
--tag ${{ secrets.DOCKER_HUB_USER }}/${{ matrix.service }}:$TAG \
--build-context rustgbt=./rust \
--build-context backend=./backend \
--output "type=image,push=false" \
--build-arg commitHash=$SHORT_SHA \
./${{ matrix.service }}/
else
docker buildx build \
--cache-from "type=local,src=/tmp/.buildx-cache" \
--cache-to "type=local,dest=/tmp/.buildx-cache,mode=max" \
--platform linux/amd64,linux/arm64 \
--tag ${{ secrets.DOCKER_HUB_USER }}/${{ matrix.service }}:$TAG \
--build-context rustgbt=./rust \
--build-context backend=./backend \
--output "type=registry,push=true" \
--build-arg commitHash=$SHORT_SHA \
./${{ matrix.service }}/
fi
docker buildx build \
--cache-from "type=local,src=/tmp/.buildx-cache" \
--cache-to "type=local,dest=/tmp/.buildx-cache,mode=max" \
--platform linux/amd64,linux/arm64 \
--tag ${{ secrets.DOCKER_HUB_USER }}/${{ matrix.service }}:$TAG \
--build-context rustgbt=./rust \
--build-context backend=./backend \
--output "type=registry,push=true" \
--build-arg commitHash=$SHORT_SHA \
./${{ matrix.service }}/
tag-latest:
needs: build