-
Notifications
You must be signed in to change notification settings - Fork 1
84 lines (69 loc) · 2.06 KB
/
pages.yml
File metadata and controls
84 lines (69 loc) · 2.06 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
name: Deploy live showcase to GitHub Pages
on:
push:
branches: [main]
workflow_dispatch:
# Single in-flight deploy; cancel any earlier in-progress run for the same ref.
concurrency:
group: pages
cancel-in-progress: true
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Slint system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libfontconfig1-dev \
libfreetype6-dev \
libxkbcommon-dev \
libgl1-mesa-dev
- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- uses: Swatinem/rust-cache@v2
with:
workspaces: examples/showcase
- name: Install wasm-pack
run: |
if ! command -v wasm-pack >/dev/null 2>&1; then
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
fi
- name: Build WASM bundle
working-directory: examples/showcase
run: |
wasm-pack build \
--release \
--target web \
--out-dir ../../web/pkg \
--out-name slintcn-showcase
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Build static registry (index at /registry.json, items at /r/<name>.json)
run: node bin/slintcn.mjs build -o web
- name: Copy screenshots for the landing page
run: |
mkdir -p web/img
cp docs/img/snapshots/*.png web/img/
- name: Generate docs site (per-component pages with live previews)
run: node scripts/build-docs.mjs -o web/docs
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: web/
deploy:
runs-on: ubuntu-latest
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4