Skip to content

Update main.yml

Update main.yml #25

Workflow file for this run

# Simple workflow for deploying static content to GitHub Pages
name: Deploy to GitHub Pages
on:
# Runs on pushes targeting the 'release' branch
push:
branches:
- master
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
pages: write
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Restore cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin
~/.cargo/git
~/.cargo/registry
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Set up Rust nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
- name: Install trunk
run: cargo install trunk
- name: Install WebAssembly target
run: rustup target add wasm32-unknown-unknown
- name: Install tailwindcss
run: npm install tailwindcss
- name: Build with Trunk
run: trunk build --release --public-url ${{ github.event.repository.name }}
- name: Setup Pages
id: pages
uses: actions/configure-pages@v3
- name: Create artifact
uses: actions/upload-pages-artifact@v1
with:
path: ./dist
deploy:
# Add a dependency to the build job
needs: build
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2