2023-11-05 17:22:24 +08:00
|
|
|
name: Deploy demo
|
|
|
|
on:
|
|
|
|
push:
|
2024-01-03 20:52:56 +08:00
|
|
|
paths: ["demo/**", "demo_markdown/**", "thaw/**"]
|
2023-11-05 17:22:24 +08:00
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
deploy:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
pull-requests: write
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
- name: Setup Rust
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
target: wasm32-unknown-unknown
|
|
|
|
override: true
|
|
|
|
- name: Install Trunk
|
|
|
|
uses: jetli/trunk-action@v0.4.0
|
|
|
|
with:
|
2024-01-16 23:41:42 +08:00
|
|
|
version: "v0.17.5"
|
2023-11-05 17:22:24 +08:00
|
|
|
- name: Deploy GitHub Pages
|
|
|
|
run: |
|
|
|
|
cd demo
|
|
|
|
trunk build --release
|
|
|
|
git worktree add gh-pages
|
|
|
|
git config user.name "Deploy demo from CI"
|
|
|
|
git config user.email ""
|
|
|
|
cd gh-pages
|
|
|
|
# Delete the ref to avoid keeping history.
|
|
|
|
git update-ref -d refs/heads/gh-pages
|
|
|
|
rm -rf *
|
|
|
|
mv ../dist/* .
|
|
|
|
git add .
|
|
|
|
git commit -m "Deploy demo $GITHUB_SHA to gh-pages"
|
|
|
|
git push --force --set-upstream origin gh-pages
|