Use multi-stage build copying dependencies from separately built image #959
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Continuous Integration | |
on: | |
pull_request: | |
branches: [main] | |
paths-ignore: | |
- 'docs/**' | |
tags: | |
- ci-test-* | |
push: | |
branches: [main] | |
paths-ignore: | |
- 'docs/**' | |
tags: | |
- ci-test-* | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build image | |
id: docker_build | |
uses: docker/build-push-action@v5 | |
with: | |
builder: ${{ steps.buildx.outputs.name }} | |
context: ./app | |
file: ./app/Dockerfile | |
tags: blast:ci | |
push: false | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: Run tests | |
run: | | |
docker pull blast:ci | |
docker tag blast:ci blast:dev | |
touch env/.env.dev | |
docker compose \ | |
--profile ci \ | |
--project-name blast \ | |
-f docker/docker-compose.yml \ | |
--env-file env/.env.default \ | |
--env-file env/.env.ci \ | |
up --exit-code-from app_ci | |
- uses: codecov/codecov-action@v4 | |
with: | |
directory: app/ |