Github Page for example #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Github Page for example | |
on: | |
workflow_dispatch | |
permissions: | |
contents: write # for committing to gh-pages branch. | |
jobs: | |
build-github-pages: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup toolchain for wasm | |
run: | | |
rustup update stable | |
rustup default stable | |
rustup set profile minimal | |
rustup target add wasm32-unknown-unknown | |
- name: Rust Cache | |
uses: Swatinem/rust-cache@v2 | |
with: | |
workspaces: "examples/web -> target" | |
- name: Download and install Trunk binary | |
run: wget -qO- https://github.com/thedodd/trunk/releases/latest/download/trunk-x86_64-unknown-linux-gnu.tar.gz | tar -xzf- | |
- name: Build | |
run: | | |
cd examples/web/ | |
../../trunk build --release --public-url ${{ env.public_url }} | |
env: | |
public_url: "https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}" | |
- name: Deploy | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
folder: examples/web/dist/ | |
single-commit: true |