Skip to content

Commit 09947bf

Browse files
committed
🚧 restore db from cache
1 parent 3890052 commit 09947bf

2 files changed

Lines changed: 10 additions & 12 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,16 @@ jobs:
2424
python-version: ['3.12', '3.13', '3.14']
2525
steps:
2626
- uses: actions/checkout@v4
27-
- name: Start Elasticsearch
28-
run: docker compose -f compose-dev.yaml up --wait elasticsearch
27+
- name: Start services
28+
run: docker compose -f compose-dev.yaml up --wait
29+
- uses: actions/cache/restore@v5
30+
id: db_cache
31+
with:
32+
path: dump.gz
33+
key: ${{ runner.os }}-${{ hashFiles('compose-dev.yaml') }}
34+
- name: Restore database
35+
if: steps.db_cache.outputs.cache-hit == 'true'
36+
run: gunzip dump.gz | docker compose -f compose-dev.yaml exec -T db psql -U fragdenstaat_de -X fragdenstaat_de
2937
- name: Setup uv
3038
uses: astral-sh/setup-uv@v6
3139
with:
@@ -53,12 +61,3 @@ jobs:
5361
run: |
5462
pytest --durations 0 -v -n auto --cov --cov-report= fragdenstaat_de/
5563
coverage report --format=markdown >> $GITHUB_STEP_SUMMARY
56-
services:
57-
postgres:
58-
image: postgis/postgis:16-3.4
59-
env:
60-
POSTGRES_USER: fragdenstaat_de
61-
POSTGRES_PASSWORD: fragdenstaat_de
62-
POSTGRES_DB: fragdenstaat_de
63-
ports:
64-
- 5432:5432

‎.github/workflows/database-cache.yml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
workflow_dispatch:
55
schedule:
66
- cron: 0 14 * * 0
7-
push:
87

98
jobs:
109
dump:

0 commit comments

Comments
 (0)