Skip to content

Build docs

Build docs #68

Workflow file for this run

name: Build docs
on:
push:
branches:
- main
# Run this workflow when a tag or branch is created
create:
# trigger manually
workflow_dispatch:
jobs:
build:
if: github.event_name == 'workflow_dispatch' || github.event_name == 'create' && github.event.ref_type == 'tag' && github.event.repository.fork == false
runs-on: ubuntu-latest
env:
CONFIGDB_URL: http://configdb-dev
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r .poetry-version
poetry install
- name: Build docs
run: |
poetry run python manage.py generateschema_mocked --file downtime.yaml --generator_class=downtime.schema.DowntimeSchemaGenerator
npx redoc-cli bundle downtime.yaml
mkdir docs; mv redoc-static.html docs/downtime.html
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3 # https://github.com/peaceiris/actions-gh-pages
with:
personal_token: ${{ secrets.PERSONAL_TOKEN }}
external_repository: observatorycontrolsystem/observatorycontrolsystem.github.io
publish_branch: main
publish_dir: docs
destination_dir: assets/html
enable_jekyll: true
keep_files: true
exclude_assets: '.github,openapi,.redocly.yaml,LICENSE,README.md,make.sh'