Skip to content

Improved web client functionality #13

Improved web client functionality

Improved web client functionality #13

Workflow file for this run

name: Deploy Schemus web client
on:
push:
branches:
- main
env:
WORK_DIR: ./schemus-web
WEB_PAGE_SOURCE: schemus-web.html
WEB_PAGE: index.html
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install rustup
run: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
- name: Install wasm-pack
run: cargo install wasm-pack
- name: Add Rust WASM target
run: rustup target add wasm32-unknown-unknown
- name: Build WASM package
run: wasm-pack build --release --target web
working-directory: ${{ env.WORK_DIR }}
- name: Generate final web page
run: cp $WEB_PAGE_SOURCE $WEB_PAGE
working-directory: ${{ env.WORK_DIR }}
- name: Upload web page artifact
uses: actions/upload-artifact@v3
with:
name: web-page
path: ${{ env.WORK_DIR }}/${{ env.WEB_PAGE }}
if-no-files-found: error
- name: Upload WASM package artifact
uses: actions/upload-artifact@v3
with:
name: wasm-pkg
path: ${{ env.WORK_DIR }}/pkg
if-no-files-found: error
deploy:
name: Deploy
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: Download web page artifact
uses: actions/download-artifact@v3
with:
name: web-page
path: ./dist
- name: Download WASM package artifact
uses: actions/download-artifact@v3
with:
name: wasm-pkg
path: ./dist/pkg
- name: Remove vicious .gitignore
run: rm ./dist/pkg/.gitignore
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist