thaw/.github/workflows/gh-pages.yml

46 lines
1.5 KiB
YAML
Raw Normal View History

2023-10-11 10:35:44 +08:00
name: Build gh-pages
on:
schedule:
- cron: "0 23 * * *"
jobs:
get-melt-changed:
uses: ./.github/workflows/get-melt-changed.yml
deploy:
runs-on: ubuntu-latest
needs: [get-melt-changed]
if: needs.get-melt-changed.outputs.melt_changed == 'true'
permissions:
contents: write # To push a branch
pull-requests: write # To create a PR from that branch
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:
version: "latest"
- name: Deploy GitHub Pages
run: |
2023-10-11 11:07:57 +08:00
cd demo
2023-10-11 10:35:44 +08:00
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 *
2023-10-11 11:07:57 +08:00
mv ../dist/* .
2023-10-11 10:35:44 +08:00
git add .
git commit -m "Deploy demo $GITHUB_SHA to gh-pages"
git push --force --set-upstream origin gh-pages