Merge pull request #14 from snackpass/feature/manually-place-fidesjs #13
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 | |
on: | |
push: | |
branches: | |
- main | |
release: | |
types: [published] | |
env: | |
TAG: ${{ github.event.release.tag_name }} | |
PROD_PUBLISH: true | |
jobs: | |
publish_docs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Echo the Release Tag | |
run: echo ${{ env.TAG }} | |
- name: Install Nox | |
run: pip install nox>=2022 | |
- name: Install Docs Requirements | |
run: pip install -r docs/fides/requirements.txt | |
- name: Install fides | |
run: pip install -e ./[all] | |
- name: Checkout the gh-pages branches | |
run: git fetch origin gh-pages --depth=1 | |
- name: Build docs | |
run: nox -s generate_docs | |
# This is required by "mike" | |
- name: Set the Git Username & Email | |
run: | | |
git config user.name github-actions | |
git config user.email github-actions@github.com | |
# Deploys docs without a version in the URL for legacy links | |
# This will match the "stable" version of the versioned docs | |
- name: Deploy the Legacy Docs if a Release is Published | |
if: ${{ env.TAG }} | |
run: mkdocs gh-deploy -v -f docs/fides/mkdocs.yml --force | |
- name: Deploy Stable Docs if a Release is Published | |
if: ${{ env.TAG }} | |
run: mike deploy --config-file docs/fides/mkdocs.yml --push --update-aliases ${{ env.TAG }} stable | |
# This will match "stable" when a new release is cut | |
- name: Deploy Dev Docs | |
run: mike deploy --config-file docs/fides/mkdocs.yml --push dev | |
- name: Set Default Version | |
run: mike set-default --config-file docs/fides/mkdocs.yml --push stable |