-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (75 loc) · 2.11 KB
/
deploy.yml
File metadata and controls
94 lines (75 loc) · 2.11 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Deploy
on:
workflow_run:
workflows: ["CI"]
types: [completed]
branches: [main]
workflow_dispatch:
concurrency:
group: deploy-production
cancel-in-progress: false
jobs:
gate:
name: Check CI Status
runs-on: ubuntu-latest
timeout-minutes: 5
if: >
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success')
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 20
cache: npm
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run lint
- name: Type check
run: npm run type-check
- name: Unit tests
run: npm test
env:
IRON_SESSION_PASSWORD: test-password-that-is-at-least-32-characters-long
POLL_SECRET: test-poll-secret-16chars
NEXT_PUBLIC_APP_URL: https://test.swapify.app
- name: Integration tests
run: npm run test:integration
env:
IRON_SESSION_PASSWORD: test-password-that-is-at-least-32-characters-long
POLL_SECRET: test-poll-secret-16chars
NEXT_PUBLIC_APP_URL: https://test.swapify.app
- name: Build
run: npm run build
env:
NEXT_PUBLIC_APP_URL: https://swapify.312.dev
migrate:
name: Run Database Migrations
needs: gate
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 20
cache: npm
- name: Install dependencies
run: npm ci
- name: Run migrations
run: npm run db:migrate
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
deploy:
name: Deploy to Fly.io
needs: migrate
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v6
- uses: superfly/flyctl-actions/setup-flyctl@master
- name: Deploy
run: flyctl deploy --remote-only
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}