Repository navigation
111 lines (90 loc) · 2.33 KB
/
Copy pathdeploy.yml
File metadata and controls
111 lines (90 loc) · 2.33 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: Deploy
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
typechecks:
name: Type Check & Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 22
cache: npm
- run: npm ci
- name: Type Check
run: npm run typecheck
- name: ESLint
run: npm run lint
- name: Prettier
run: npm run format:check
tests:
name: Unit Test Shard
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
shard: [1/12, 2/12, 3/12, 4/12, 5/12, 6/12, 7/12, 8/12, 9/12, 10/12, 11/12, 12/12]
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 22
cache: npm
- run: npm ci
- run: npm run test -- --shard=${{ matrix.shard }}
unit-test-status:
name: Unit Tests Status
runs-on: ubuntu-latest
needs: tests
if: always()
steps:
- name: Check unit test shard results
run: |
if [ "${{ needs.tests.result }}" = "success" ]; then
echo "All unit test shards passed"
exit 0
else
echo "Unit test shards failed: ${{ needs.tests.result }}"
exit 1
fi
build-pages:
name: Build Pages
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
needs: [typechecks, unit-test-status]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 22
cache: npm
- run: npm ci
- run: npm run build
env:
BASE_URL: /${{ github.event.repository.name }}/
- uses: actions/upload-pages-artifact@v4
with:
path: dist
deploy:
name: Deploy
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
needs: build-pages
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v5