Continuous deployment #47
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: Continuous deployment | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
# workflow_run: | |
# workflows: [Continuous integration] | |
# types: [completed] | |
# branches: [main] | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout the repository | |
- uses: actions/checkout@v2 | |
# Install the stable toolchain for Rust and target WASM | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
target: wasm32-unknown-unknown | |
- name: Rust Cache #cache build artifacts | |
uses: Swatinem/rust-cache@v1 | |
# Build the WASM with trunk | |
- uses: jetli/trunk-action@v0.1.0 | |
# Use wasm-bindgen to prepare the bindings | |
- uses: jetli/wasm-bindgen-action@v0.1.0 | |
# Build the project in release mode | |
- run: trunk build --release | |
# Deploy to GitHub Pages using the gh-pages branch | |
- uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_branch: gh-pages | |
publish_dir: ./dist |