-
Notifications
You must be signed in to change notification settings - Fork 0
151 lines (123 loc) · 4 KB
/
Copy pathdeploy.yml
File metadata and controls
151 lines (123 loc) · 4 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
name: Deploy to GitHub Pages
on:
push:
branches: [main]
workflow_dispatch:
schedule:
# Daily at 02:00 UTC — ensures deadline-based layout changes are reflected without a code push
- cron: "0 2 * * *"
permissions:
contents: read # All jobs read-only by default; deploy job overrides to write
concurrency:
group: pages
cancel-in-progress: true
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
lint-and-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version-file: .nvmrc
cache: npm
- uses: actions/cache@v6
id: npm-cache
with:
path: node_modules
key: node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
- if: steps.npm-cache.outputs.cache-hit != 'true'
run: npm ci
- name: Verify SKILL.md digest
run: |
actual=$(sha256sum public/.well-known/agent-skills/offon/SKILL.md | cut -d' ' -f1)
stored=$(node -e "const j=require('./public/.well-known/agent-skills/index.json'); console.log(j.skills[0].digest.replace('sha256:', ''))")
if [ "$actual" != "$stored" ]; then
echo "SKILL.md digest mismatch — update the digest in index.json after editing SKILL.md"
echo " index.json: sha256:$stored"
echo " computed: sha256:$actual"
exit 1
fi
echo "SKILL.md digest OK: sha256:$actual"
- run: npm run sync
- run: npm run lint
- run: npm run check
- run: npm run test:unit:coverage
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version-file: .nvmrc
cache: npm
- uses: actions/cache@v6
id: npm-cache
with:
path: node_modules
key: node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
- if: steps.npm-cache.outputs.cache-hit != 'true'
run: npm ci
- run: npm run sync
- run: npm run build
- uses: actions/upload-artifact@v7
with:
name: dist
path: dist/
retention-days: 1
e2e:
needs: build
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version-file: .nvmrc
cache: npm
- uses: actions/cache@v6
id: npm-cache
with:
path: node_modules
key: node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
- if: steps.npm-cache.outputs.cache-hit != 'true'
run: npm ci
- uses: actions/download-artifact@v7
with:
name: dist
path: dist/
- uses: actions/cache@v6
id: playwright-cache
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
- if: steps.playwright-cache.outputs.cache-hit != 'true'
run: npx playwright install --with-deps chromium
- if: steps.playwright-cache.outputs.cache-hit == 'true'
run: npx playwright install-deps chromium
# playwright.config webServer runs a plain Node.js static server (serves dist/).
- run: npm run test:e2e -- --shard=${{ matrix.shard }}/3
deploy:
needs: [lint-and-check, e2e]
runs-on: ubuntu-latest
permissions:
contents: write # Required by JamesIves/github-pages-deploy-action to push gh-pages
steps:
- uses: actions/checkout@v7
- uses: actions/download-artifact@v7
with:
name: dist
path: dist/
- name: Deploy to gh-pages
uses: JamesIves/github-pages-deploy-action@fa24774553152dd7873cd16ebd8d959b010c5445 # v4
with:
branch: gh-pages
folder: dist
force: false
clean: true
clean-exclude: |
pr-preview/