Explict action to deploy pages #9
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: Version-dependent docs build & deploy | |
on: | |
push: | |
branches: | |
- main | |
- "0.80" | |
jobs: | |
setup: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.x | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
build: | |
runs-on: ubuntu-latest | |
needs: setup | |
steps: | |
- name: Generate project showcase pages from .yaml files | |
run: python build_tools/generate_showcase_pages.py | |
- name: Configure github | |
run: | | |
git config --global user.name Docs deploy | |
git config --global user.email [email protected] | |
- name: Fetch gh-pages branch | |
run: | | |
git fetch | |
git checkout gh-pages | |
git pull | |
git checkout ${{ github.ref_name }} | |
- name: Publish 0.80 website and API reference | |
if: ${{ github.ref_name == '0.80' }} | |
run: | | |
mike deploy --push --update-aliases 0.80 dev | |
- name: Publish latest docs website and API reference | |
if: ${{ github.ref_name == 'main' }} | |
run: | | |
mike deploy --push --update-aliases 0.57 latest | |
deploy: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Upload Artifact | |
uses: actions/upload-pages-artifact@v2 | |
with: | |
# upload entire directory | |
path: '.' | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v2 |