Skip to content

Adjust pseudocode

Adjust pseudocode #76

Workflow file for this run

name: site_deploy
on:
push:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: true
# Default to bash
defaults:
run:
shell: bash
env:
CARGO_TERM_COLOR: always
FORCE_COLOR: 1
jobs:
build:
runs-on: ubuntu-latest
env:
WASM_DIR: ./crates/radlr-wasm
WEB_SOURCE_DIR: ./site
LAB_SRC_DIR: ./site/assets/js/radlr
LAB_PUB_DIR: ./site/static/js/lab
DOC_PUB_DIR: ./site/public
steps:
- uses: actions/checkout@v3
- name: Install latest nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
components: rustfmt, clippy
- name: Cargo's version is
run: cargo --version
- name: Install Wasm-Pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Install HUGO
run: curl -LJOo hugo.deb .deb https://github.com/gohugoio/hugo/releases/download/v0.117.0/hugo_extended_0.117.0_linux-amd64.deb && sudo dpkg -i hugo.deb
- name: HUGO's version is
run: hugo version
- name: Create Base Directories
run: mkdir -p $LAB_SRC_DIR && mkdir -p $LAB_PUB_DIR
- name: Get Node Packages
working-directory: ${{ env.WEB_SOURCE_DIR }}
run: npm install
- name: Build Radlr WASM
working-directory: ${{ env.WASM_DIR }}
run: wasm-pack build --target web
- name: Copy WASM to HUGO build environment
run: cp $WASM_DIR/pkg/* $LAB_SRC_DIR/ && mv $LAB_SRC_DIR/radlr_wasm_bg.wasm $LAB_PUB_DIR/
- name: Setup Pages
id: pages
uses: actions/configure-pages@v3
- name: Build Site
env:
# For maximum backward compatibility with Hugo modules
HUGO_ENVIRONMENT: production
HUGO_ENV: production
working-directory: ${{ env.WEB_SOURCE_DIR }}
run: hugo --minify -b ${{ steps.pages.outputs.base_url }}
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: ${{ env.DOC_PUB_DIR }}
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2