Refactor Docker workflow to conditionally push images based on version tags
Some checks failed
Docker Build Test / build (3.10) (push) Successful in 26s
Docker Build Test / build (3.13) (push) Successful in 31s
Build and Publish Docker Image / build (push) Has been cancelled
Docker Build Test / build (3.11) (push) Successful in 24s
Docker Build Test / build (3.12) (push) Successful in 33s
Docker Build Test / build (3.9) (push) Successful in 28s
Safety / security (push) Successful in 28s

- Updated the push condition for Docker builds to only trigger on version tags.
- Removed caching options from Docker build steps for both standard and rootless images.
This commit is contained in:
2025-12-27 13:05:33 -06:00
parent 4f8f2786ab
commit 112348d862

View File

@@ -61,15 +61,13 @@ jobs:
context: .
file: ./docker/Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
push: ${{ startsWith(github.ref, 'refs/tags/v') }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
BUILD_DATE=${{ github.event.head_commit.timestamp }}
VCS_REF=${{ github.sha }}
VERSION=${{ steps.meta.outputs.version }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Extract metadata (tags, labels) for Docker (rootless)
id: meta_rootless
@@ -89,12 +87,10 @@ jobs:
context: .
file: ./docker/Dockerfile.rootless
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
push: ${{ startsWith(github.ref, 'refs/tags/v') }}
tags: ${{ steps.meta_rootless.outputs.tags }}
labels: ${{ steps.meta_rootless.outputs.labels }}
build-args: |
BUILD_DATE=${{ github.event.head_commit.timestamp }}
VCS_REF=${{ github.sha }}
VERSION=${{ steps.meta_rootless.outputs.version }}
cache-from: type=gha
cache-to: type=gha,mode=max