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
- Updated the workflow to remove specific Dockerfile paths from the filters, focusing on directory-based builds for frontend, main, and r-api services.
- Changed the build command to use the --no-cache option, ensuring fresh builds on the production branch.
- Improved the overall efficiency of the CI/CD pipeline by refining the conditions for building images based on branch context.

These changes enhance the clarity and performance of the Docker image management process, ensuring that builds are more reliable and streamlined.
  • Loading branch information
jhagberg committed Jan 3, 2025
1 parent bbb3799 commit dfaf54a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/create_packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,12 @@ jobs:
filters: |
frontend:
- 'frontend/**'
- 'docker/frontend.Dockerfile'
- '.docker/frontend'
main:
- 'app/**'
- 'docker/main.Dockerfile'
- '.docker/main'
r-api:
- 'R/**'
- 'docker/r-api.Dockerfile'
- '.docker/r-api'
build:
Expand Down Expand Up @@ -89,7 +87,7 @@ jobs:
run: |
# Only build on production branch, tags will just retag existing images
if [[ "${{ github.ref_name }}" == "production" ]]; then
docker compose build --build-arg BUILDKIT_INLINE_CACHE=1 herdbook-frontend main
docker compose build --no-cache --build-arg BUILDKIT_INLINE_CACHE=1 herdbook-frontend main
elif [[ "${{ github.ref_type }}" != "tag" ]]; then
# For other branches (except tags), only build changed images and their dependents
if [[ "${{ needs.changes.outputs.frontend }}" == "true" ]]; then
Expand Down

0 comments on commit dfaf54a

Please sign in to comment.