Dev/tools documentations #35
Workflow file for this run
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: Deploy MkDocs | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- '**' # Match all branches for pull requests | |
release: | |
types: | |
- published | |
jobs: | |
deploy-pr: | |
if: github.event_name == 'pull_request' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.12' | |
- name: Install poetry | |
run: | | |
pip install poetry | |
- name: Configure Poetry | |
run: | | |
echo "$HOME/.local/bin" >> $GITHUB_PATH | |
- name: Install dependencies | |
run: | | |
poetry install --with main,docs | |
- name: Deploy to GitHub Pages (Pull Request) | |
env: | |
ACTIONS_DEPLOY_TOKEN: ${{ secrets.ACTIONS_DEPLOY_TOKEN }} | |
run: | | |
git config --global user.name '${{ github.actor }}' | |
git config --global user.email '${{ github.actor }}@users.noreply.github.com' | |
poetry run mike deploy --push develop | |
deploy-main: | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.12' | |
- name: Install poetry | |
run: | | |
pip install poetry | |
- name: Configure Poetry | |
run: | | |
echo "$HOME/.local/bin" >> $GITHUB_PATH | |
- name: Install dependencies | |
run: | | |
poetry install --with main,docs | |
- name: Deploy to GitHub Pages (Main) | |
env: | |
ACTIONS_DEPLOY_TOKEN: ${{ secrets.ACTIONS_DEPLOY_TOKEN }} | |
run: | | |
git config --global user.name '${{ github.actor }}' | |
git config --global user.email '${{ github.actor }}@users.noreply.github.com' | |
poetry run mike deploy --push main | |
poetry run mike set-default --push main | |
deploy-release: | |
if: github.event_name == 'release' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.12' | |
- name: Install poetry | |
run: | | |
pip install poetry | |
- name: Configure Poetry | |
run: | | |
echo "$HOME/.local/bin" >> $GITHUB_PATH | |
- name: Install dependencies | |
run: | | |
poetry --version | |
poetry install --with main,docs | |
- name: Set release notes tag | |
run: | | |
export RELEASE_TAG_VERSION=${{ github.event.release.tag_name }} | |
echo "RELEASE_TAG_VERSION=${RELEASE_TAG_VERSION}" >> $GITHUB_ENV | |
- name: Deploy to GitHub Pages | |
env: | |
ACTIONS_DEPLOY_TOKEN: ${{ secrets.ACTIONS_DEPLOY_TOKEN }} | |
run: | | |
git config --global user.name '${{ github.actor }}' | |
git config --global user.email '${{ github.actor }}@users.noreply.github.com' | |
poetry run mike deploy --push --update-aliases ${RELEASE_TAG_VERSION} latest | |
poetry run mike set-default --push latest |