Skip to content

Deploy

Deploy #4

Workflow file for this run

on:
workflow_dispatch:
name: Deploy
jobs:
deploy:
name: Build WASM & website
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
repository: hyperquark/hyperquark
path: hyperquark
- name: Install nightly toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
target: wasm32-unknown-unknown
- name: Install wasm-bindgen
uses: actions-rs/cargo@v1
with:
command: install
args: -f wasm-bindgen-cli
- name: Install cargo-outdir
uses: actions-rs/cargo@v1
with:
command: install
args: cargo-outdir
- name: Install node
uses: actions/setup-node@v3
with:
node-version: "20.x"
- name: Run npm install
run: |
cd $GITHUB_WORKSPACE/hyperquark
npm install
npm i -g vite
npm i -g binaryen@nightly
- name: Build
env:
VITE_HASH_HISTORY: false
NODE_ENV: production
run: |
cd $GITHUB_WORKSPACE/hyperquark
chmod +x build.sh && ./build.sh -Wpz
vite build --base=/
- name: Move files to tmp
run: mv $GITHUB_WORKSPACE/hyperquark/playground/dist /tmp/hq-dist
- name: checkout website repo
uses: actions/checkout@v4
with:
path: website
- name: move file to website repo
run: |
cd $GITHUB_WORKSPACE/website
rm -rf assets index.html logo.png favicon.ico renderer.js
mv /tmp/hq-dist/* $GITHUB_WORKSPACE/website/
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Build website