Skip to content

Reorganize builtins

Reorganize builtins #5

Workflow file for this run

name: Publish Web Page
on:
push:
branches:
- main
paths:
- .github/workflows/**
- schemius/**
- schemius-web/**
env:
WORK_DIR: ./schemius-web
WEB_PAGE: index.html
WEB_PAGE_SOURCE: schemius-web.html
WEB_PAGE_JS: schemius.utils.js
ARTIFACTS: artifacts
PUBLISH_DIR: ./dist
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: Produce WASM package
run: |
cargo install wasm-pack
rustup target add wasm32-unknown-unknown
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 artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARTIFACTS }}
path: |
${{ env.WORK_DIR }}/${{ env.WEB_PAGE }}
${{ env.WORK_DIR }}/${{ env.WEB_PAGE_JS }}
${{ 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 artifacts
uses: actions/download-artifact@v4
with:
name: ${{ env.ARTIFACTS }}
path: ${{ env.PUBLISH_DIR }}
- name: Remove vicious .gitignore
run: rm ${{ env.PUBLISH_DIR }}/pkg/.gitignore
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ${{ env.PUBLISH_DIR }}