Skip to content

Support query parameters in routes (#752) #26

Support query parameters in routes (#752)

Support query parameters in routes (#752) #26

name: Examples
on:
push:
branches: [main]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
target: wasm32-unknown-unknown
default: true
- name: Setup NodeJS
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Install trunk
run: >
wget -qO-
https://github.com/thedodd/trunk/releases/download/v0.21.1/trunk-x86_64-unknown-linux-gnu.tar.gz
| tar -xzf- && sudo mv trunk /usr/bin/
- name: Cargo generate-lockfile
run: cargo generate-lockfile
- name: Cargo cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Build examples
run: |
output="$(pwd)/dist"
mkdir "$output"
for path in examples/*; do
if [[ ! -d $path ]]; then
continue
fi
example=$(basename "$path")
echo "building: $example"
(
cd "$path"
dist_dir="$output/$example"
mkdir "$dist_dir"
trunk build --release --dist "$dist_dir" --public-url "/$example"
)
done
- name: Create .nojekyll file
run: touch dist/.nojekyll
- name: Upload static files as artifact
uses: actions/upload-pages-artifact@v3
with:
path: dist/
deploy:
name: Deploy
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4