-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (72 loc) · 2.03 KB
/
ci.yml
File metadata and controls
87 lines (72 loc) · 2.03 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
name: CI & Deploy
on:
push:
branches:
- main
paths-ignore:
- "**.md"
- "docs/**"
- ".vscode/**"
- "CHANGELOG.md"
pull_request:
branches:
- main
paths-ignore:
- "**.md"
- "docs/**"
- ".vscode/**"
workflow_dispatch:
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
permissions: {}
jobs:
ci:
runs-on: ubuntu-24.04
timeout-minutes: 10
permissions:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Set up Node.js
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version-file: ".nvmrc"
- name: Set up pnpm
uses: pnpm/action-setup@f40ffcd9367d9f12939873eb1018b921a783ffaa # v4
with:
version: 10
run_install: false
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Setup Biome CLI
uses: biomejs/setup-biome@4c91541eaada48f67d7dbd7833600ce162b68f51 # v2.7.1
- name: Lint
run: pnpm run lint
- name: Type check
run: pnpm run type-check
- name: Test
run: pnpm run test
- name: Build
run: pnpm run build
deploy:
needs: ci
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
runs-on: ubuntu-24.04
timeout-minutes: 2
permissions: {}
steps:
- name: Trigger Cloudflare Pages deploy
run: |
response=$(curl -sS -w "\n%{http_code}" -X POST "${{ secrets.CF_PAGES_DEPLOY_HOOK_URL }}")
http_code=$(echo "$response" | tail -1)
body=$(echo "$response" | head -1)
echo "Cloudflare response: HTTP $http_code"
if [ "$http_code" -lt 200 ] || [ "$http_code" -ge 300 ]; then
echo "Deploy hook failed: $body"
exit 1
fi
echo "Deploy hook triggered successfully"