-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (47 loc) · 1.56 KB
/
Copy pathdeploy.yml
File metadata and controls
58 lines (47 loc) · 1.56 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
name: Deploy
on:
push:
branches: [main]
workflow_dispatch:
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
jobs:
deploy-api:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: superfly/flyctl-actions/setup-flyctl@master
- name: Deploy API to Fly.io
run: flyctl deploy --app repopilot-api --config fly.api.toml --remote-only --wait-timeout 300
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
deploy-worker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: superfly/flyctl-actions/setup-flyctl@master
- name: Deploy Worker to Fly.io
run: flyctl deploy --app repopilot-worker --config fly.worker.toml --remote-only --wait-timeout 300
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
migrate:
runs-on: ubuntu-latest
needs: deploy-api
steps:
- uses: superfly/flyctl-actions/setup-flyctl@master
- name: Run Alembic migrations
run: |
flyctl ssh console \
--app repopilot-api \
--command "/bin/bash -c 'cd /app/packages/core && alembic upgrade head'"
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
healthcheck:
runs-on: ubuntu-latest
needs: [deploy-api, deploy-worker, migrate]
steps:
- name: API health
run: |
STATUS=$(curl -sf https://repopilot-api.fly.dev/healthz | python3 -c "import sys,json; print(json.load(sys.stdin).get('status','?'))")
echo "API status: $STATUS"
[ "$STATUS" = "ok" ]