-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (70 loc) · 2.26 KB
/
build-github.yml
File metadata and controls
85 lines (70 loc) · 2.26 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
# Skill browser UI lives in ./web (self-contained package.json + lockfile).
# Deploy output is ./web/dist (Vite `build.outDir`, relative to web/).
#
# Repo root: compile TS + generate web/public/catalog.json from configured sources (templates/sources.config.yaml
# in CI via build-catalog). Then build only what's inside web/.
#
# Triggers:
# - push to main: rebuild catalog from upstream GitHub sources, build web, deploy Pages.
# - schedule / workflow_dispatch: same pipeline — refresh listings without pushing code (each run is a clean checkout;
# catalog is regenerated via GitHub API; no reliance on local .cache).
name: Deploy Web App to GitHub Pages
on:
push:
branches: ["main"]
workflow_dispatch:
schedule:
# Weekly Monday 06:00 UTC — adjust cadence/time as needed (cron is UTC).
- cron: "0 6 * * 1"
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
name: Build
env:
# Higher GitHub API limits for catalog hydration (github-tree-skills-provider).
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: npm
cache-dependency-path: |
package-lock.json
web/package-lock.json
- name: Install root dependencies
run: npm ci
- name: Install web dependencies
run: npm ci --prefix web
- name: Compile TypeScript (catalog pipeline)
run: npm run build
- name: Generate catalog JSON (into web/public/)
run: npm run build:catalog
- name: Build frontend from ./web (outputs web/dist)
run: npm run build --prefix web
env:
CI: true
- name: Upload Pages artifact (contents of web/dist)
uses: actions/upload-pages-artifact@v3
with:
path: web/dist
deploy:
name: Deploy
runs-on: ubuntu-latest
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4