-
Notifications
You must be signed in to change notification settings - Fork 108
43 lines (40 loc) · 1.34 KB
/
gh-pages.yml
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
name: github pages
on:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
targets: x86_64-unknown-linux-gnu,wasm32-unknown-unknown
- uses: Swatinem/rust-cache@v2
with:
cache-all-crates: "true"
save-if: ${{ github.ref == 'refs/heads/main' }}
- uses: cargo-bins/cargo-binstall@main
- name: Install CLI
run: cargo binstall dioxus-cli -y --force
- name: Build
run: dx build --release --features web
- name: Build Static HTML
run: cargo run --release --features prebuild
- name: Create 404.html
run: cp docs/index.html docs/404.html
- name: Rebuild with search index
run: dx build --release --features web && cp docs/404.html docs/index.html
- name: Deploy 🚀
uses: JamesIves/[email protected]
with:
branch: gh-pages # The branch the action should deploy to.
folder: docs # The folder the action should deploy.
target-folder: .
clean: false # don't scrub docs