Build & Deploy Site #2
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
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install rust with wasm | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
components: rust-src | |
target: wasm32-unknown-unknown | |
- name: Install Binstall | |
uses: cargo-bins/cargo-binstall@main | |
- name: Install trunk | |
run: "cargo binstall --no-confirm trunk" | |
- name: Build website | |
run: "trunk build" | |
deploy: | |
# Deploy to the github-pages environment | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
# Add a dependency to the build job | |
needs: build | |
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment | |
permissions: | |
id-token: write # to verify the deployment originates from an appropriate source | |
pages: write # to deploy to Pages | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Pages | |
uses: actions/configure-pages@v3 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v2 | |
with: | |
# Upload entire repository | |
path: 'site/' | |
- id: deployment | |
name: Deploy to GitHub Pages | |
uses: actions/deploy-pages@v2 | |
name: Build & Deploy Site | |
on: | |
release: | |
types: | |
- published | |
workflow_dispatch: |