Skip to content

Commit 63d00b4

Browse files
committed
Make stable replicate the last published tag with format "vX.Y.Z"
1 parent f247c78 commit 63d00b4

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

.github/workflows/build-deploy-docs.yml

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,9 @@ jobs:
5454

5555
- name: Update default site redirect (tag event only)
5656
if: startsWith(github.ref, 'refs/tags/')
57-
run: |
58-
# Extract the tag name from the GITHUB_REF variable.
59-
TAG_NAME=${GITHUB_REF##*/}
60-
# Create an index.html file that redirects to /<tag>/index.html.
61-
echo "<!DOCTYPE html><html><head><meta http-equiv=\"refresh\" content=\"0; url=./${TAG_NAME}/index.html\" /></head><body></body></html>" > docs/build/index.html
62-
# Clone the gh-pages branch using token authentication
63-
git clone --branch gh-pages https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} gh-pages
64-
cp docs/build/index.html gh-pages/index.html
65-
cd gh-pages
66-
git config user.name "github-actions"
67-
git config user.email "github-actions@github.com"
68-
git add index.html
69-
git commit -m "Update default documentation redirect to tag ${GITHUB_REF##*/}" || echo "No changes to commit"
70-
git push origin gh-pages
57+
uses: peaceiris/actions-gh-pages@v4
58+
with:
59+
github_token: ${{ secrets.GITHUB_TOKEN }}
60+
publish_dir: docs/build/dirhtml
61+
destination_dir: stable
62+
publish_branch: gh-pages

0 commit comments

Comments
 (0)