Skip to content

django-ocs-observation-portal 4.12.0 (#310) #306

django-ocs-observation-portal 4.12.0 (#310)

django-ocs-observation-portal 4.12.0 (#310) #306

name: Build docs
on:
push:
branches:
- main
# Run this workflow when a tag or branch is created
create:
jobs:
build:
if: github.event_name == 'create' && github.event.ref_type == 'tag' && github.event.repository.fork == false
runs-on: ubuntu-latest
env:
SECRET_KEY: fakesecretkey
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install 'poetry'
poetry install
env:
SETUPTOOLS_USE_DISTUTILS: stdlib
- name: Build docs
run: |
poetry run python manage.py generateschema_mocked --file observation-portal.yaml --generator_class=observation_portal.common.schema.ObservationPortalSchemaGenerator
npx redoc-cli bundle observation-portal.yaml
mkdir openapi; mv redoc-static.html openapi/observation-portal.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_dir: openapi
destination_dir: assets/html
enable_jekyll: true
publish_branch: main
keep_files: true
exclude_assets: '.github,openapi,.redocly.yaml,LICENSE,README.md,make.sh'