Deploy to GitHub Pages
GitHub Pages can serve the public/ directory generated by GenGen. Common approaches:
- GitHub Actions โ use the official
actions/deploy-pagesworkflow to build and publish on push. - Manual publish โ build locally with
gengen buildand push thepublic/folder to thegh-pagesbranch.
Sample Workflow
name: Deploy
on:
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dart-lang/setup-dart@v1
- run: dart pub get
- run: gengen build docs
- uses: actions/upload-pages-artifact@v2
with:
path: docs/public
deploy:
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: $
steps:
- uses: actions/deploy-pages@v2