File tree Expand file tree Collapse file tree 1 file changed +6
-14
lines changed
Expand file tree Collapse file tree 1 file changed +6
-14
lines changed Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments