This repository has been archived by the owner on Mar 19, 2024. It is now read-only.
Update quickstart #124
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: CI | |
"on": | |
push: | |
branches: | |
- master | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
permissions: | |
contents: read | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Create default environment | |
run: cp config/.env.template config/.env | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Build the image | |
uses: docker/bake-action@v3 | |
with: | |
files: docker-compose.yml | |
targets: web | |
load: true | |
set: | | |
*.cache-from=type=gha,scope=cached-stage | |
*.cache-to=type=gha,scope=cached-stage,mode=max | |
- name: Test | |
run: | | |
docker compose run \ | |
-e DJANGO_SECRET_KEY --user=root --rm web ./docker/django/ci.sh | |
env: | |
# This must not be public and must be stored as a secret value. | |
# But, we don't really care in this homework. | |
DJANGO_SECRET_KEY: | | |
htrG1aAJYa9fwmVMoW13PL0zwIFcwBV4iCevHTJzZHmpq1oR8Q |