Skip to content

Commit 452c72c

Browse files
committed
[FIX] Fixed workflow redirection
1 parent 7ee388e commit 452c72c

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

.github/workflows/docs.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,27 @@ jobs:
3131
git config user.name github-actions
3232
git config user.email github-actions@github.com
3333
34+
- name: Fetch gh-pages branch
35+
run: |
36+
if git ls-remote --exit-code --heads origin gh-pages > /dev/null 2>&1; then
37+
git fetch origin gh-pages:gh-pages
38+
echo "Fetched existing gh-pages branch"
39+
else
40+
echo "gh-pages branch does not exist yet, mike will create it"
41+
fi
42+
3443
- name: Deploy docs (versioned)
3544
env:
3645
GH_TOKEN: ${{ secrets.GH_TOKEN }}
3746
run: |
3847
# Always use the latest git tag as version
3948
VERSION=$(git describe --tags --abbrev=0 | sed 's/^v//')
4049
mike deploy --push --update-aliases "$VERSION" latest
50+
51+
# Re-fetch gh-pages after deploy to get the updated branch
52+
git fetch origin gh-pages:gh-pages --force
4153
mike set-default --push latest
54+
55+
# Verify
56+
echo "Mike versions:"
57+
mike list

0 commit comments

Comments
 (0)