Skip to content

deploy-github-page

deploy-github-page #8

Workflow file for this run

name: deploy-github-page
on: [workflow_dispatch]
# on: [push, workflow_dispatch]
# workflow_dispatch:
permissions:
contents: write
# defaults:
# run:
# shell: bash
# working-directory: crates/gbpplanner-rs
jobs:
install-dependencies:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: install apt dependencies
run: sudo apt-get update; sudo apt-get install -y pkg-config libx11-dev libasound2-dev libudev-dev # libfreetype6-dev libfontconfig1-dev
- name: install mold linker
uses: rui314/setup-mold@v1
- name: install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
# targets: wasm32-unknown-unknown
toolchain: stable
- name: Add wasm target
run: rustup target add wasm32-unknown-unknown
- name: install trunk
uses: jetli/[email protected]
with:
version: 'latest'
# build-wasm-binary:
# working-directory: crates/gbpplanner-rs
# runs-on: ubuntu-latest
# needs: [install-dependencies]
# steps:
- name: Build wasm binary
run: |
trunk build --release --public-url /${{ github.event.repository.name }}
working-directory: crates/gbpplanner-rs
- name: optimize Wasm
uses: NiklasEi/wasm-opt-action@v2
# working-directory: crates/gbpplanner-rs
with:
# file: dist/*.wasm
file: ./crates/gbpplanner-rs/dist/*.wasm
# deploy-to-github-pages:
# working-directory: crates/gbpplanner-rs
# runs-on: ubuntu-latest
# needs: [build-wasm-binary]
# steps:
- name: Deploy to GitHub Pages
uses: JamesIves/[email protected]
# working-directory: crates/gbpplanner-rs
with:
branch: gh-pages
single-commit: true
# folder: ./dist
folder: ./crates/gbpplanner-rs/dist