Skip to content

Commit 412e7ac

Browse files
authored
Merge pull request #20 from pythonsul/chore-update-git-workflow
refactor: refresh github pages cache
2 parents bbc5f7b + d4de511 commit 412e7ac

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

.github/workflows/build.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ jobs:
3030
- name: Build site
3131
run: make build
3232

33+
- name: Copy CNAME
34+
run: |
35+
if [ -f CNAME ]; then
36+
cp CNAME ${{ env.PUBLISH_DIR }}/
37+
fi
38+
3339
- name: Deploy to GitHub Pages
3440
if: github.ref == 'refs/heads/main'
3541
uses: peaceiris/actions-gh-pages@v4
@@ -38,3 +44,10 @@ jobs:
3844
publish_dir: ${{ env.PUBLISH_DIR }}
3945
publish_branch: ${{ env.PUBLISH_BRANCH }}
4046
commit_message: "Deploy site to GitHub Pages - ${{ github.sha }}"
47+
48+
- name: Refresh GitHub Pages Cache
49+
if: github.ref == 'refs/heads/main'
50+
run: |
51+
curl -X POST -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
52+
-H "Accept: application/vnd.github+json" \
53+
https://api.github.com/repos/${{ github.repository }}/pages/builds || echo "Failed to refresh GitHub Pages cache"

0 commit comments

Comments
 (0)