deploy #10
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 | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | |
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: wasm32-unknown-unknown | |
- uses: jetli/[email protected] | |
with: | |
version: 'latest' | |
- uses: taiki-e/install-action@v2 | |
with: | |
tool: zola | |
- name: Build bundle | |
run: | | |
rm -rf dist/ | |
(cd www-zola && zola build --output-dir ../dist) | |
wasm-pack build --release --target web | |
# 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: actions/configure-pages@v4 | |
- uses: actions/upload-pages-artifact@v3 | |
with: | |
path: './dist' | |
retention-days: 2 | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 | |