mirror of
https://github.com/Vale54321/schafkop-neu.git
synced 2025-12-13 10:39:33 +01:00
62 lines
1.3 KiB
YAML
62 lines
1.3 KiB
YAML
name: Deploy WebAssembly to GitHub Pages
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- rust
|
|
workflow_dispatch: {}
|
|
|
|
permissions:
|
|
contents: read
|
|
pages: write
|
|
id-token: write
|
|
|
|
concurrency:
|
|
group: pages
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build:
|
|
name: Build WebAssembly
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Rust
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
targets: wasm32-unknown-unknown
|
|
|
|
- name: Cache cargo
|
|
uses: Swatinem/rust-cache@v2
|
|
with:
|
|
workspaces: schafkopf-logic
|
|
cache-directories: |
|
|
~/.cache/trunk
|
|
|
|
- name: Install trunk
|
|
run: cargo install trunk --locked
|
|
|
|
- name: Build with trunk
|
|
working-directory: schafkopf-logic
|
|
run: |
|
|
trunk build --release --public-url "/${{ github.event.repository.name }}/"
|
|
|
|
- name: Upload Pages artifact
|
|
uses: actions/upload-pages-artifact@v3
|
|
with:
|
|
path: schafkopf-logic/dist
|
|
|
|
deploy:
|
|
name: Deploy to GitHub Pages
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
environment:
|
|
name: github-pages
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
steps:
|
|
- name: Deploy
|
|
id: deployment
|
|
uses: actions/deploy-pages@v4
|