File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11name : Create database cache
22
33on :
4- workflow_dispatch :
5- schedule :
6- - cron : 0 14 * * 0
4+ push :
75
86jobs :
7+ check :
8+ runs-on : ubuntu-latest
9+ outputs :
10+ cache_hit : ${{ steps.db_cache.outputs.cache-hit }}
11+ steps :
12+ - uses : actions/checkout@v6
13+ - name : Restore database cache
14+ uses : actions/cache/restore@v5
15+ id : db_cache
16+ with :
17+ path : cache-dump.sql
18+ key : db-${{ runner.os }}-${{ hashFiles('fragdenstaat_de/**/migrations/*.py') }}
19+
920 dump :
1021 runs-on : ubuntu-latest
22+ needs : check
23+ if : needs.check.outputs.cache_hit != 'true' # don't use == 'false'!
1124 steps :
1225 - uses : actions/checkout@v6
1326 - name : Start database
2437 - name : Run migrations
2538 run : python manage.py migrate --skip-checks # due to django-cms issue
2639 - name : Create database dump
27- run : docker compose -f compose-dev.yaml exec db pg_dump -U fragdenstaat_de fragdenstaat_de | gzip > dump.gz
40+ run : docker compose -f compose-dev.yaml exec db pg_dump -U fragdenstaat_de fragdenstaat_de > cache- dump.sql
2841 - name : Save dump
2942 uses : actions/cache/save@v5
3043 with :
31- path : dump.gz
32- key : ${{ runner.os }}-${{ hashFiles('compose-dev.yaml ') }}
44+ path : cache- dump.sql
45+ key : db- ${{ runner.os }}-${{ hashFiles('fragdenstaat_de/**/migrations/*.py ') }}
You can’t perform that action at this time.
0 commit comments