Skip to content

Commit b8972c4

Browse files
ops(KDP): fix docs release errors
1 parent 37da166 commit b8972c4

File tree

2 files changed

+25
-13
lines changed

2 files changed

+25
-13
lines changed

.github/workflows/MANUAL_DOCS_PUBLISH.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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

.github/workflows/RELEASE.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -187,14 +187,19 @@ jobs:
187187
poetry config virtualenvs.create false
188188
poetry install --only doc --no-interaction
189189
190+
- name: Fetch gh-pages branch
191+
run: |
192+
git config user.name "${{ github.actor }}"
193+
git config user.email "${{ github.actor }}@users.noreply.github.com"
194+
195+
# Fetch the gh-pages branch
196+
git fetch origin gh-pages:gh-pages || echo "No gh-pages branch exists yet"
197+
190198
- name: Release documentation with mike
191199
id: deploy_docs
192200
run: |
193201
echo "Deploying documentation for version ${{ steps.get_docs_version.outputs.VERSION }}"
194202
195-
git config user.name "${{ github.actor }}"
196-
git config user.email "${{ github.actor }}@users.noreply.github.com"
197-
198203
# Attempt to deploy docs
199204
mike deploy --push --update-aliases ${{ steps.get_docs_version.outputs.VERSION }} latest
200205
continue-on-error: true
@@ -203,8 +208,9 @@ jobs:
203208
if: steps.deploy_docs.outcome == 'failure'
204209
run: |
205210
echo "First documentation deploy attempt failed, retrying..."
206-
sleep 10
207-
git pull --rebase
211+
212+
# Force-fetch the latest gh-pages branch
213+
git fetch origin gh-pages:gh-pages --force
208214
209215
# Use the version from recovery process
210-
mike deploy --push --update-aliases ${{ steps.get_docs_version.outputs.VERSION }} latest
216+
mike deploy --push --update-aliases --force ${{ steps.get_docs_version.outputs.VERSION }} latest

0 commit comments

Comments
 (0)