Skip to content

fix(web): Fix base URL override handling. #87

fix(web): Fix base URL override handling.

fix(web): Fix base URL override handling. #87

name: ci-web-publish
on:
push:
branches: ["main"]
# release:
# types: [created]
# Allows to run this workflow manually from the Actions tab
workflow_dispatch:
# Set 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: false
jobs:
web-publish-build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: "wasm32-unknown-unknown"
components: "clippy, rustfmt"
- name: Install protoc
run: sudo apt-get install protobuf-compiler
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Install mdbook
run: |
mkdir ~/bin
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.40/mdbook-v0.4.40-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory="$HOME/bin"
- name: Build documentation
working-directory: ${{github.workspace}}/docs
run: ~/bin/mdbook build
- name: Build wasm bindings
working-directory: ${{github.workspace}}/web/tband-wasm
run: wasm-pack build
- name: Run rust tests
working-directory: ${{github.workspace}}/web/tband-wasm
run: cargo test --all
- name: Run clippy
working-directory: ${{github.workspace}}/web/tband-wasm
run: cargo clippy -- -D warnings
- name: Check rust format
working-directory: ${{github.workspace}}/web/tband-wasm
run: cargo fmt -- --check
- name: Setup node env
working-directory: ${{github.workspace}}/web/website
run: npm install
- name: Build website
working-directory: ${{github.workspace}}/web/website
run: npm run build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ${{github.workspace}}/web/website/dist
web-deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: web-publish-build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4