Skip to content

Merge branch 'main' into website #56

Merge branch 'main' into website

Merge branch 'main' into website #56

Workflow file for this run

name: Deploy website
on:
push:
paths:
- "book/**"
- "examples/**"
- "lightyear/**"
- ".github/workflows/website.yaml"
branches:
- website
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write # To push a branch
pages: write # To push to a GitHub Pages site
id-token: write # To update the deployment status
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install latest mdbook
run: |
tag=$(curl 'https://api.github.com/repos/rust-lang/mdbook/releases/latest' | jq -r '.tag_name')
url="https://github.com/rust-lang/mdbook/releases/download/${tag}/mdbook-${tag}-x86_64-unknown-linux-gnu.tar.gz"
mkdir mdbook
curl -sSL $url | tar -xz --directory=./mdbook
echo `pwd`/mdbook >> $GITHUB_PATH
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install mdbook-mermaid
run: cargo install mdbook-mermaid
- name: Install mdbook-linkcheck
run: cargo install mdbook-linkcheck
- name: Build Book
run: |
cd book
mdbook build
mv book/html/* book
cd ..
- name: Install trunk
run: |
cargo install --git https://github.com/trunk-rs/trunk trunk
- name: Build Examples
run: |
rustup target add wasm32-unknown-unknown
cd examples/bullet_prespawn
trunk build --release
cd ../..
cd examples/client_replication
trunk build --release
cd ../..
cd examples/interest_management
trunk build --release
cd ../..
cd examples/leafwing_inputs
trunk build --release
cd ../..
cd examples/priority
trunk build --release
cd ../..
cd examples/replication_groups
trunk build --release
cd ../..
cd examples/simple_box
trunk build --release
cd ../..
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Show book content
shell: sh
run: |
ls -la book && ls -la book/book && ls -la book/book/html
- name: Tar artifact
shell: sh
run: |
tar \
--dereference --hard-dereference \
--exclude=.git \
--exclude=.github \
-cvf "$RUNNER_TEMP/artifact.tar" \
./examples/**/dist \
-C book ./book
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: github-pages
path: ${{ runner.temp }}/artifact.tar
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4