Publish docs via GitHub Pages #559
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: Publish docs via GitHub Pages | |
on: | |
push: | |
branches: | |
- main | |
- release/** | |
schedule: | |
# https://crontab.guru/#3_21_*_*_6 | |
- cron: "3 21 * * 6" | |
jobs: | |
build: | |
name: Deploy docs | |
runs-on: ubuntu-latest | |
if: github.actor != 'dependabot[bot]' | |
steps: | |
- name: Checkout main | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Python 3.10 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
python3 -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Configure git user | |
run: | | |
git config --global user.name "${GITHUB_ACTOR}" | |
git config --global user.email "${GITHUB_ACTOR}@users.noreply.${GITHUB_DOMAIN:-github.com}" | |
- name: Deploy dev docs | |
if: github.ref == 'refs/heads/main' | |
run: mike deploy --push --update-aliases DEV | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Deploy release docs | |
if: github.ref != 'refs/heads/main' | |
run: mike deploy --push --update-aliases ${GITHUB_REF##*/} RELEASE | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |