Skip to content

Commit 0ec8ecd

Browse files
committed
feat: build yew.rs website with Yew (#2779)
1 parent acd2a33 commit 0ec8ecd

File tree

2,843 files changed

+161777
-86
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,843 files changed

+161777
-86
lines changed

.github/workflows/build-website.yml

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,18 @@ on:
33
pull_request:
44
branches: [master]
55
paths:
6-
- "website/**"
7-
- "firebase.json"
6+
- "yew-rs/**"
7+
- "website/static/**"
8+
- "Cargo.toml"
9+
- "Cargo.lock"
810
- ".github/workflows/*-website.yml"
911
push:
1012
branches: [master]
1113
paths:
12-
- "website/**"
13-
- "firebase.json"
14+
- "yew-rs/**"
15+
- "website/static/**"
16+
- "Cargo.toml"
17+
- "Cargo.lock"
1418
- ".github/workflows/*-website.yml"
1519

1620
jobs:
@@ -20,40 +24,36 @@ jobs:
2024
steps:
2125
- uses: actions/checkout@v6
2226

23-
- name: Setup node
24-
uses: actions/setup-node@v6
27+
- name: Setup toolchain
28+
uses: dtolnay/rust-toolchain@master
2529
with:
26-
node-version: "lts/Jod"
27-
package-manager-cache: false
30+
toolchain: stable
31+
targets: wasm32-unknown-unknown
2832

29-
- name: Install dependencies
30-
run: |
31-
cd website
32-
npm ci
33+
- uses: Swatinem/rust-cache@v2
34+
with:
35+
save-if: ${{ github.ref == 'refs/heads/master' }}
3336

34-
- name: Run prettier
35-
id: fmt
36-
continue-on-error: true
37-
run: |
38-
cd website
39-
npm run fmt
37+
- name: Install wasm-bindgen-cli
38+
shell: bash
39+
run: ./ci/install-wasm-bindgen-cli.sh
4040

41-
- if: steps.fmt.outcome == 'failure'
42-
run: |
43-
cd website
44-
npm run fmt:write
45-
git diff
46-
exit 1
41+
- name: Get latest wasm-opt version
42+
id: wasm-opt
43+
uses: pozetroninc/github-action-get-latest-release@master
44+
with:
45+
repository: WebAssembly/binaryen
46+
excludes: prerelease, draft
47+
token: ${{ secrets.GITHUB_TOKEN }}
4748

48-
- name: Check Translations
49+
- name: Install wasm-opt
4950
run: |
50-
cd website
51-
npm run check-translations
51+
VERSION="${{ steps.wasm-opt.outputs.release }}"
52+
curl -sL "https://github.com/WebAssembly/binaryen/releases/download/${VERSION}/binaryen-${VERSION}-x86_64-linux.tar.gz" | tar xz
53+
sudo install "binaryen-${VERSION}/bin/wasm-opt" /usr/local/bin/
5254
53-
- name: Build
54-
run: |
55-
cd website
56-
npm run build
55+
- name: Build site
56+
run: cargo run --release -p yew-site-ssg
5757

5858
- name: Upload build artifact
5959
uses: actions/upload-artifact@v7

0 commit comments

Comments
 (0)