Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Do Not Merge] Experiment with Docker Caching #243

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion .github/workflows/continuous_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
runs-on: ubuntu-latest
env:
DOCKER_BUILDKIT: 1
GIT_COMMIT: ${{ github.sha }}
steps:
- uses: actions/checkout@v2

Expand All @@ -25,10 +26,29 @@ jobs:
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Set up environment
run: ./scripts/bootstrap

- run: ./scripts/cibuild
- run: ./scripts/fetch-data

- uses: docker/build-push-action@v5
with:
context: src/django
push: false
tags: iow:${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max

- run: |
docker compose up -d database django &&
./scripts/manage migrate &&
./scripts/manage collectstatic --no-input &&
docker compose stop

- run: ./scripts/test

- run: ./scripts/cipublish
if: |
Expand Down
3 changes: 2 additions & 1 deletion src/django/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ RUN set -ex \
postgresql-client \
" \
&& apt-get update && apt-get install -y $buildDeps $deps --no-install-recommends \
&& pip install --no-cache-dir -r requirements.txt \
&& pip install uv \
&& VIRTUAL_ENV=$(python -c "import sys; print(sys.prefix)") uv pip install -r requirements.txt \
&& apt-get purge -y --auto-remove $buildDeps \
$(! command -v gpg > /dev/null || echo 'gnupg dirmngr') \
&& rm -rf requirements.txt /var/lib/apt/lists/*
Expand Down
Loading