WIP: Attempt at building and caching the Docker image #2239
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
# TODO: Enable GitHub Actions on the repository to test all pull requests | ||
# https://github.com/<org>/<repo>/actions | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
- develop | ||
jobs: | ||
name: Build and cache image | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v4 | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- | ||
name: Build and cache image | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
build-args: RAILS_ENV=test | ||
push: false | ||
tags: app_test:latest | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=min | ||
test: | ||
runs-on: ubuntu-latest | ||
env: | ||
RAILS_ENV: test | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
- name: Build | ||
run: script/ci/cibuild | ||
- name: Test | ||
run: script/ci/test |