Skip to content

Refactor deploy.yml to include permissions for GitHub Pages deployment #11

Refactor deploy.yml to include permissions for GitHub Pages deployment

Refactor deploy.yml to include permissions for GitHub Pages deployment #11

Workflow file for this run

name: Deploy GH pages
on:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build-deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
targets: x86_64-unknown-linux-gnu,wasm32-unknown-unknown
- uses: Swatinem/rust-cache@v2
with:
cache-all-crates: "true"
save-if: ${{ github.ref == 'refs/heads/main' }}
- uses: cargo-bins/cargo-binstall@main
- name: Install CLI
run: cargo binstall dioxus-cli -y
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build
run: dx build --release
- name: Create 404.html
run: cp dist/index.html dist/404.html
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: 'dist'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4