Pull gh-pages in workflow. #128
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: Documentation | |
on: | |
push: | |
branches: [main, bugfix/docs*] | |
release: | |
types: [published] | |
workflow_dispatch: | |
permissions: | |
contents: write | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Configure Git Credentials | |
run: | | |
git config user.name github-actions[bot] | |
git config user.email github-actions[bot]@users.noreply.github.com | |
- name: Pull gh-pages | |
run: | | |
git fetch origin gh-pages:gh-pages | |
git checkout gh-pages | |
git pull origin gh-pages | |
git checkout main | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11 | |
cache: "pip" | |
- name: Install | |
run: | | |
pip install ".[dev]" | |
- name: Get Current Version | |
if: ${{ github.event_name == 'release' }} | |
run: | | |
export CURRENT_VERSION=$(bump-my-version show current_version) | |
echo CURRENT_VERSION=$CURRENT_VERSION >> $GITHUB_ENV | |
shell: bash | |
- name: Publish release | |
if: ${{ github.event_name == 'release' }} | |
run: mike deploy --push --update-aliases ${{ env.CURRENT_VERSION }} latest | |
- name: Publish development | |
if: ${{ github.event_name == 'push' }} | |
run: mike deploy --push development |