From 60b6d57dd3d15383cd1d2f7612990bb0f6825012 Mon Sep 17 00:00:00 2001 From: Valentin Heiserer Date: Sun, 2 Nov 2025 01:21:43 +0100 Subject: [PATCH] add GitHub Actions workflow for deploying WebAssembly to GitHub Pages --- .github/workflows/deploy-pages.yml | 57 ++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/deploy-pages.yml diff --git a/.github/workflows/deploy-pages.yml b/.github/workflows/deploy-pages.yml new file mode 100644 index 0000000..8923fe4 --- /dev/null +++ b/.github/workflows/deploy-pages.yml @@ -0,0 +1,57 @@ +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 (trunk -> dist) + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Rust (stable + wasm32) + uses: dtolnay/rust-toolchain@stable + with: + targets: wasm32-unknown-unknown + + - name: Cache cargo + uses: Swatinem/rust-cache@v2 + + - 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