Fix(update-readme) (#130) #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: OLAF documentation | |
# Controls when the workflow will run | |
on: | |
# Triggers the workflow on push or pull request events but only for the main branch | |
push: | |
branches: [ main ] | |
# pull_request: | |
# branches: [ gh-pages ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
environment: github-pages | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v3 | |
env: | |
GITHUB_TOKEN: ${{ secrets.TOKEN }} | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.10" | |
- name: move on gh-pages | |
uses: actions/checkout@v3 | |
with: | |
ref: gh-pages | |
- name: Rebase gh-pages onto main | |
run: | | |
git config --global user.email "${{ vars.USER_MAIL }}" | |
git config --global user.name "${{ vars.USER_NAME }}" | |
git pull --rebase origin main | |
git push --force origin gh-pages | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r docs/requirements.txt | |
pip install . | |
- name: Build HTML | |
run: | | |
sphinx-apidoc -o docs olaf/ | |
cd docs/ | |
make clean | |
make html | |
- name: Run ghp-import | |
run: | | |
ghp-import -n -p -f docs/_build/html |