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
name: Pages
on:
push:
branches:
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- uses: Swatinem/rust-cache@v2
- name: Install Trunk
uses: jetli/trunk-action@1346cc09eace4beb84e403e199a471346d4684c9 # v0.5.1
with:
version: v0.21.14
- name: Configure Pages
id: pages
uses: actions/configure-pages@v5
- name: Build Web gallery
working-directory: gallery/web
run: trunk build --release --locked --public-url /
- name: Verify Pages bundle
run: |
test -s gallery/web/dist/index.html
test -n "$(find gallery/web/dist -maxdepth 1 -type f -name '*.js' -size +0c -print -quit)"
test -n "$(find gallery/web/dist -maxdepth 1 -type f -name '*.wasm' -size +0c -print -quit)"
test "$(cat gallery/web/dist/CNAME)" = "mirui.rs"
test -s gallery/web/dist/robots.txt
test -s gallery/web/dist/sitemap.xml
test -s gallery/web/dist/site.webmanifest
test -s gallery/web/dist/favicon.svg
test -s gallery/web/dist/orbit-console.png
grep --fixed-strings --quiet '<link rel="canonical" href="https://mirui.rs/"' gallery/web/dist/index.html
grep --fixed-strings --quiet 'property="og:image" content="https://mirui.rs/orbit-console.png"' gallery/web/dist/index.html
grep --extended-regexp --quiet "from '/[^']+\\.js'" gallery/web/dist/index.html
grep --extended-regexp --quiet "module_or_path: '/[^']+\\.wasm'" gallery/web/dist/index.html
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: gallery/web/dist
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy Pages
id: deployment
uses: actions/deploy-pages@v4