From 9310fc7cd6ae878ad3110184d904ff7f8882dc09 Mon Sep 17 00:00:00 2001 From: Steven Bal Date: Tue, 24 Dec 2024 14:42:11 +0100 Subject: [PATCH 1/2] :construction_worker: [maykinmedia/objects-api#463] Add cache job for trivy --- .github/workflows/trivy-db-cache.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .github/workflows/trivy-db-cache.yml diff --git a/.github/workflows/trivy-db-cache.yml b/.github/workflows/trivy-db-cache.yml new file mode 100644 index 0000000..2b3925c --- /dev/null +++ b/.github/workflows/trivy-db-cache.yml @@ -0,0 +1,10 @@ +name: Call Update Trivy Cache + +on: + workflow_dispatch: # Manual trigger for testing purposes + schedule: + - cron: '51 0 * * *' # Run daily + +jobs: + call-update-trivy-cache: + uses: maykinmedia/open-api-workflows/.github/workflows/ci.yml@v3.0.2 From 314189505c7dadd21ba132bb890eacbb9c11937e Mon Sep 17 00:00:00 2001 From: Steven Bal Date: Tue, 24 Dec 2024 14:53:51 +0100 Subject: [PATCH 2/2] :green_heart: Wait until migrations are done in quickstart job --- .github/workflows/quick_start.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/quick_start.yml b/.github/workflows/quick_start.yml index 1cf3eb4..91f0baa 100644 --- a/.github/workflows/quick_start.yml +++ b/.github/workflows/quick_start.yml @@ -11,6 +11,13 @@ jobs: run: wget https://raw.githubusercontent.com/maykinmedia/objecttypes-api/feature/merge-docker-composes/docker-compose.yml - name: Start docker containers run: docker compose up -d --no-build + - name: Wait for migrations to finish + run: | + echo "Waiting for migrations to complete..." + until ! docker compose exec -T web src/manage.py showmigrations | grep -q '\[ \]'; do + echo "Migrations not finished, waiting..." + sleep 3 + done - name: Load fixtures run: docker compose exec -T web src/manage.py loaddata demodata - name: Create superuser