HexCasting/.github/workflows/build_docs.yml

42 lines
922 B
YAML
Raw Normal View History

2023-08-07 01:27:52 +02:00
name: Build the web book
2022-05-21 17:56:52 +02:00
2022-05-21 18:42:05 +02:00
on:
push:
branches: [main]
2023-08-07 01:27:52 +02:00
workflow_dispatch:
2022-05-21 17:56:52 +02:00
jobs:
build_docs:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
2023-08-07 01:27:52 +02:00
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install docgen
run: pip install .
2023-08-07 01:27:52 +02:00
2022-05-21 17:56:52 +02:00
- name: Generate file
run: hexdoc doc/properties.toml -o index.html.uncommitted --ci
2023-08-07 01:27:52 +02:00
2022-05-21 17:56:52 +02:00
- name: Check out gh-pages
uses: actions/checkout@v3
with:
clean: false
ref: gh-pages
2023-08-07 01:27:52 +02:00
2022-05-21 17:56:52 +02:00
- name: Overwrite file and commmit
run: |
mv index.html.uncommitted index.html
2023-08-07 01:27:52 +02:00
git config user.name "HexDoc Bot"
2022-05-21 17:56:52 +02:00
git config user.email "noreply@github.com"
git add index.html
2023-08-07 01:27:52 +02:00
git diff-index --quiet HEAD || git commit -m "Update web book from $GITHUB_REF"
2022-05-21 17:56:52 +02:00
- name: Upload changes
run: git push