GitHub Pages deployment¶
The project already has a game site, so the docs site must not take over the GitHub Pages root path. The deployment strategy is to publish the game at the root path and the MkDocs site under /docs/.
Published URLs:
https://billzi2016.github.io/Othello-AI/
https://billzi2016.github.io/Othello-AI/docs/
What the workflow does¶
.github/workflows/pages.yml builds the game and docs in one deployment:
- Installs the Rust toolchain.
- Installs
wasm-bindgen-cli. - Builds
rust-aiforwasm32-unknown-unknown. - Generates
assets/wasm/othello_ai.jsandassets/wasm/othello_ai_bg.wasm. - Installs the MkDocs dependencies from
docs-site/requirements.txt. - Builds
docs-site/mkdocs.yml. - Copies the game files into the
_site/root. - Copies
docs-site/site/into_site/docs/. - Uploads
_site/and deploys it to GitHub Pages.
Expected deployment result¶
After deployment, the root path should open the game, and /docs/ should open the MkDocs site. Both paths come from the same Pages deployment, so separate workflows do not overwrite each other.
If the root path shows the docs site, the artifact layout is wrong. If /docs/ returns 404, check that the MkDocs build step ran and that _site/docs/index.html exists.