-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (49 loc) · 1.32 KB
/
Copy pathci.yml
File metadata and controls
53 lines (49 loc) · 1.32 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
name: CI
on:
pull_request:
push:
branches:
- main
permissions:
contents: read
jobs:
check:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version-file: .node-version
cache: npm
- run: npm ci
- run: npm run check
deploy:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
needs: check
runs-on: ubuntu-latest
timeout-minutes: 15
concurrency:
group: production
cancel-in-progress: false
environment:
name: production
url: ${{ vars.ARTIFACTS_URL }}
env:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version-file: .node-version
cache: npm
- run: npm ci
- name: Restore deployment configuration
env:
CLOUDFLARE_WRANGLER_CONFIG: ${{ secrets.CLOUDFLARE_WRANGLER_CONFIG }}
run: node scripts/write-deployment-config.mjs
- name: Apply D1 migrations
run: npx wrangler d1 migrations apply DB --remote --config wrangler.jsonc
- name: Deploy service
run: npm run deploy