Deploy to Pages #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
name: Deploy to Pages | |
on: | |
release: | |
types: [published] | |
workflow_dispatch: | |
# schedule: | |
# - cron: '0 1 * * *' | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
# Allow one concurrent deployment | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout 🛎️ | |
uses: actions/checkout@v4 | |
- name: Rust 🧰 | |
run: | | |
curl https://sh.rustup.rs -sSf | sh -s -- -y | |
source $HOME/.cargo/env | |
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh -s -- -y | |
- name: Node 🧰 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
cache: 'npm' | |
- name: Install 📦 | |
run: npm install | |
- name: Run Unit Tests 🧪 | |
run: npm test | |
- name: Build 🛠 | |
run: npm run build | |
- name: Setup Pages 🧰 | |
uses: actions/configure-pages@v5 | |
- name: Upload artifact 🚀 | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: ./dist/ | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Deploy to GitHub Pages 🚀 | |
id: deployment | |
uses: actions/deploy-pages@v4 |