@@ -39,14 +39,19 @@ jobs:
3939 poetry config virtualenvs.create false
4040 poetry install --only doc --no-interaction
4141
42+ - name : Fetch gh-pages branch
43+ run : |
44+ git config user.name "${{ github.actor }}"
45+ git config user.email "${{ github.actor }}@users.noreply.github.com"
46+
47+ # Fetch the gh-pages branch
48+ git fetch origin gh-pages:gh-pages || echo "No gh-pages branch exists yet"
49+
4250 - name : Release documentation with mike
4351 id : deploy_docs
4452 run : |
4553 echo "Deploying documentation for version ${{ inputs.RELEASE_VERSION }}"
4654
47- git config user.name "${{ github.actor }}"
48- git config user.email "${{ github.actor }}@users.noreply.github.com"
49-
5055 # Set up command based on whether to update latest alias
5156 if [[ "${{ inputs.UPDATE_LATEST }}" == "true" ]]; then
5257 echo "Updating 'latest' alias to point to version ${{ inputs.RELEASE_VERSION }}"
@@ -64,12 +69,13 @@ jobs:
6469 if : steps.deploy_docs.outcome == 'failure'
6570 run : |
6671 echo "First documentation deploy attempt failed, retrying..."
67- sleep 10
68- git pull --rebase
72+
73+ # Force-fetch the latest gh-pages branch
74+ git fetch origin gh-pages:gh-pages --force
6975
7076 # Set up command based on whether to update latest alias
7177 if [[ "${{ inputs.UPDATE_LATEST }}" == "true" ]]; then
72- mike deploy --push --update-aliases ${{ inputs.RELEASE_VERSION }} latest
78+ mike deploy --push --update-aliases --force ${{ inputs.RELEASE_VERSION }} latest
7379 else
74- mike deploy --push ${{ inputs.RELEASE_VERSION }}
80+ mike deploy --push --force ${{ inputs.RELEASE_VERSION }}
7581 fi
0 commit comments