Skip to content

Build & Deploy Pages #14

Build & Deploy Pages

Build & Deploy Pages #14

name: Build & Deploy Pages
'on':
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
workflow_dispatch: ~
jobs:
build-wasm:
name: Build wasm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: numworks/setup-emscripten@bbc4f5e15974bc13e69fdadecfd1858ecb1c4dbb # there is no v1 tag/branch
with:
sdk: 3.1.42
- uses: actions/cache@v3
with:
path: /opt/hostedtoolcache/emscripten/latest/x64/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/lto
key: libs-${{ hashFiles('~/work/Trilangle/Trilangle/emsdk/upstream/emscripten/system/lib/**.c') }}
restore-keys: "libs-\n"
- name: Run build script
shell: bash
run: |
cd wasm
npm ci --omit dev --no-fund
./build_wasm.sh
mkdir ../Release
mv *.css index.js worker.js ldworker.js *.wasm ../Release/
cp *.html favicon.ico ../Release/
- uses: actions/upload-pages-artifact@v2
with:
path: Release/
deploy-pages:
name: Deploy GitHub Pages
runs-on: ubuntu-latest
needs: build-wasm
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v2
with:
error_count: 1