@@ -27,39 +27,45 @@ jobs:
2727 git config user.name "github-actions[bot]"
2828 git config user.email "github-actions[bot]@users.noreply.github.com"
2929
30- - name : Create gh-pages branch
31- run : |
32- git checkout --orphan gh-pages
33- git rm -rf .
34- echo "# GitHub Pages" > README.md
35- git add README.md
36- git commit -m "Initialize empty gh-pages branch"
37- git push origin gh-pages
38- git checkout main
39-
40- - name : Enable GitHub Pages (set source to gh-pages / root)
41- env :
42- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
43- run : |
44- REPO_FULL="${{ github.repository }}"
45- OWNER="${{ github.repository_owner }}"
46- REPO="${{ github.event.repository.name }}"
47- # Create/enable Pages site
48- curl -s -X POST \
49- -H "Authorization: Bearer $GITHUB_TOKEN" \
50- -H "Accept: application/vnd.github+json" \
51- -H "Content-Type: application/json" \
52- "https://api.github.com/repos/${REPO_FULL}/pages" \
53- -d '{"source":{"branch":"gh-pages","path":"\/"}}' | jq .
30+ - uses : actions/configure-pages@v4
31+ - uses : actions/upload-pages-artifact@v3
32+ with :
33+ path : ./public
34+ - uses : actions/deploy-pages@v4
5435
55- # Set repo homepage (Website field)
56- PAGES_URL="https://${OWNER}.github.io/${REPO}"
57- curl -s -X PATCH \
58- -H "Authorization: Bearer $GITHUB_TOKEN" \
59- -H "Accept: application/vnd.github+json" \
60- -H "Content-Type: application/json" \
61- "https://api.github.com/repos/${REPO_FULL}" \
62- -d "{\"homepage\": \"${PAGES_URL}\"}" | jq .
36+ # - name: Create gh-pages branch
37+ # run: |
38+ # git checkout --orphan gh-pages
39+ # git rm -rf .
40+ # echo "# GitHub Pages" > README.md
41+ # git add README.md
42+ # git commit -m "Initialize empty gh-pages branch"
43+ # git push origin gh-pages
44+ # git checkout main
45+ #
46+ # - name: Enable GitHub Pages (set source to gh-pages / root)
47+ # env:
48+ # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+ # run: |
50+ # REPO_FULL="${{ github.repository }}"
51+ # OWNER="${{ github.repository_owner }}"
52+ # REPO="${{ github.event.repository.name }}"
53+ # # Create/enable Pages site
54+ # curl -s -X POST \
55+ # -H "Authorization: Bearer $GITHUB_TOKEN" \
56+ # -H "Accept: application/vnd.github+json" \
57+ # -H "Content-Type: application/json" \
58+ # "https://api.github.com/repos/${REPO_FULL}/pages" \
59+ # -d '{"source":{"branch":"gh-pages","path":"\/"}}' | jq .
60+ #
61+ # # Set repo homepage (Website field)
62+ # PAGES_URL="https://${OWNER}.github.io/${REPO}"
63+ # curl -s -X PATCH \
64+ # -H "Authorization: Bearer $GITHUB_TOKEN" \
65+ # -H "Accept: application/vnd.github+json" \
66+ # -H "Content-Type: application/json" \
67+ # "https://api.github.com/repos/${REPO_FULL}" \
68+ # -d "{\"homepage\": \"${PAGES_URL}\"}" | jq .
6369
6470 - name : Remove files
6571 run : |
0 commit comments