deploy #1
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
on: [workflow_dispatch] | |
name: deploy | |
jobs: | |
deploy: | |
name: Build and publish to GitHub pages | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: wasm32-unknown-unknown | |
- uses: jetli/[email protected] | |
with: | |
version: 'latest' | |
- name: Build bundle | |
run: | | |
rm -rf dist/ | |
wasm-pack build --release --target web | |
mkdir dist | |
cp -r html dist | |
# The generated WebAssembly | |
cp -r pkg dist | |
find dist -type d -print0 | xargs -0 chmod 755 | |
find dist -type f -print0 | xargs -0 chmod 644 | |
- uses: peaceiris/actions-gh-pages@v3 | |
if: github.ref == 'refs/heads/main' | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./dist | |