50 lines
1.2 KiB
YAML
50 lines
1.2 KiB
YAML
name: Deploy docs to GitHub pages
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
FORCE_COLOR: "1"
|
|
|
|
permissions:
|
|
contents: read
|
|
pages: write
|
|
id-token: write
|
|
|
|
concurrency:
|
|
group: "pages"
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
docs:
|
|
environment:
|
|
name: github-pages
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: laytan/setup-odin@v2
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Report
|
|
run: odin report
|
|
- name: Get commonmark
|
|
run: sudo apt-get install libcmark-dev
|
|
- name: Get and build Odin docs generator
|
|
run: |
|
|
cd /home/runner
|
|
git clone https://github.com/odin-lang/pkg.odin-lang.org odin-doc
|
|
cd odin-doc
|
|
# The /home/runner/odin directory is in the PATH so output it there.
|
|
odin build . -out:/home/runner/odin/odin-doc
|
|
cd /home/runner
|
|
- uses: actions/checkout@v4
|
|
- name: Generate documentation
|
|
run: ./docs/generate.sh
|
|
- uses: actions/configure-pages@v3
|
|
- uses: actions/upload-pages-artifact@v3
|
|
with:
|
|
path: ./docs/build
|
|
- uses: actions/deploy-pages@v4
|
|
id: deployment
|