Repository navigation
66 lines (55 loc) · 1.85 KB
/
Copy pathdeploy.yml
File metadata and controls
66 lines (55 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Deploy to Production
on:
workflow_dispatch: # manual trigger only
jobs:
# ── Job 1: sanity check that the pipeline runs ───
pipeline-check:
name: Pipeline check
runs-on: [self-hosted, opentechdb-runner]
steps:
- name: Pipeline passed
run: echo "✅ Pipeline is working!"
# ── Job 2: deploy the app ───
deploy:
name: Deploy app
runs-on: [self-hosted, opentechdb-runner]
needs: pipeline-check
steps:
- uses: actions/checkout@v4
- name: Configure Supabase secrets
run: bash deploy/supabase/setup-secrets.sh
- name: Start Supabase stack
run: |
docker network create opentech 2>/dev/null || true
docker compose -f deploy/supabase/compose.yml --env-file /opt/opentech-db/supabase.env up -d
- name: Apply database migrations
run: bash deploy/supabase/apply-migrations.sh
# ── Frontend: build the SPA and publish it for nginx ──
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Build frontend
working-directory: frontend
env:
VITE_API_BASE_URL: https://otdb.th-deg.de/api/v1
run: |
set -a
source /opt/opentech-db/.env
set +a
npm ci
npm run build
- name: Publish frontend to nginx web root
run: |
rm -rf /var/www/opentech-db/*
cp -r frontend/dist/* /var/www/opentech-db/
- name: Deploy containers
run: |
docker compose \
--env-file /opt/opentech-db/.env \
-f docker-compose.prod.yml \
up -d --build
echo " Deployed"
- name: Sync technology catalogue to Supabase
run: |
docker exec opentech-db python scripts/seed_supabase_catalogue.py
docker restart opentech-db