Skip to content

Commit

Permalink
Refactor Docker image build process in create_packages.yml
Browse files Browse the repository at this point in the history
Removed the --label argument from the Docker build commands in the create_packages.yml workflow. This change simplifies the build process by eliminating unnecessary labeling, while maintaining the integrity of the build logic for different branches. The workflow continues to support efficient image building based on branch context, ensuring a streamlined CI/CD pipeline.
  • Loading branch information
jhagberg committed Jan 3, 2025
1 parent b9856e2 commit 413ce4d
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/create_packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,25 +95,21 @@ jobs:
# Build frontend and main with new version
docker compose build --build-arg BUILDKIT_INLINE_CACHE=1 \
--build-arg COMMIT_SHA="${{ github.sha }}" \
--label "org.opencontainers.image.revision=${{ github.sha }}" \
herdbook-frontend main
elif [[ "${{ github.ref_name }}" == "production" ]]; then
echo "Production branch - building fresh images"
docker compose build --no-cache --build-arg BUILDKIT_INLINE_CACHE=1 \
--build-arg COMMIT_SHA="${{ github.sha }}" \
--label "org.opencontainers.image.revision=${{ github.sha }}" \
herdbook-frontend main
else
# For other branches, only build changed images and their dependents
if [[ "${{ needs.changes.outputs.frontend }}" == "true" ]]; then
docker compose build --build-arg BUILDKIT_INLINE_CACHE=1 \
--build-arg COMMIT_SHA="${{ github.sha }}" \
--label "org.opencontainers.image.revision=${{ github.sha }}" \
herdbook-frontend main
elif [[ "${{ needs.changes.outputs.main }}" == "true" ]]; then
docker compose build --build-arg BUILDKIT_INLINE_CACHE=1 \
--build-arg COMMIT_SHA="${{ github.sha }}" \
--label "org.opencontainers.image.revision=${{ github.sha }}" \
main
fi
Expand Down

0 comments on commit 413ce4d

Please sign in to comment.