Repository navigation
Simplify build and workflow #40
This file contains hidden or 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 site | ||
| on: | ||
| push: | ||
| branches: [main] | ||
| workflow_dispatch: {} | ||
| permissions: | ||
| contents: read | ||
| pages: write | ||
| id-token: write | ||
| concurrency: | ||
| group: pages | ||
| cancel-in-progress: true | ||
| jobs: | ||
| deploy: | ||
| runs-on: ubuntu-latest | ||
| needs: build | ||
| environment: | ||
| name: github-pages | ||
| url: ${{ steps.deployment.outputs.page_url }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: "22" | ||
| cache: "npm" | ||
| - name: Install JS deps for npx | ||
| run: npm ci | ||
| - uses: dtolnay/rust-toolchain@stable | ||
| with: | ||
| targets: wasm32-unknown-unknown | ||
| - uses: taiki-e/install-action@v2 | ||
| with: | ||
| tool: cargo-binstall | ||
| - name: Install dioxus-cli | ||
| run: cargo binstall -y dioxus-cli | ||
| - name: Bundle site | ||
| run: dx bundle --platform web --release --locked --out-dir site | ||
| - name: Move from public dir | ||
| run: mv site/public/* site | ||
| - name: SPA fallback for GitHub Pages | ||
| run: cp site/index.html site/404.html | ||
| - name: Upload artifact | ||
| uses: actions/upload-pages-artifact@v3 | ||
| with: | ||
| path: site | ||
| - name: Deploy to GitHub Pages | ||
| id: deployment | ||
| uses: actions/deploy-pages@v4 | ||