Skip to content

Correct Docs CI

Correct Docs CI #1016

Workflow file for this run

name: Docs CI
on:
push:
branches:
# Add more branches here to publish docs from other branches
- master
- main
tags:
- "*"
pull_request:
jobs:
build:
name: "Docs CI"
runs-on: ubuntu-22.04
steps:
- name: Checkout Source
uses: actions/checkout@v2
with:
# require history to get back to last tag for version number of branches
fetch-depth: 0
submodules: true
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.7"
- name: Install Python Dependencies
run: |
pip install pipenv
pipenv install --dev --deploy --python $(which python) && pipenv graph
- name: Build Docs
run: pipenv run docs
- name: Move to versioned directory
# e.g. master or 0.1.2
run: mv build/html ".github/pages/${GITHUB_REF##*/}"
- name: Publish Docs to gh-pages
if: github.ref_type == 'tag' || github.ref_name == 'main' || github.ref_name == 'master'
# We pin to the SHA, not the tag, for security reasons.
# https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: .github/pages
keep_files: true