Skip to content

Commit 9090098

Browse files
committed
cache burst
1 parent e92dce2 commit 9090098

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

.github/workflows/jekyll-gh-pages.yml

+18
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,23 @@ jobs:
3333
uses: actions/checkout@v4
3434
- name: Setup Pages
3535
uses: actions/configure-pages@v5
36+
- name: Generate build timestamp
37+
id: timestamp
38+
run: echo "timestamp=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_OUTPUT
39+
- name: Create cache-busting file
40+
run: |
41+
mkdir -p ./docs/assets
42+
echo "// Cache busting timestamp: ${{ steps.timestamp.outputs.timestamp }}" > ./docs/assets/cache-buster.js
43+
echo "Cache-Control: no-cache, no-store, must-revalidate" > ./docs/assets/.htaccess
3644
- name: Build with Jekyll
3745
uses: actions/jekyll-build-pages@v1
3846
with:
3947
source: ./docs
4048
destination: ./_site
4149
- name: Upload artifact
4250
uses: actions/upload-pages-artifact@v3
51+
with:
52+
path: ./_site
4353

4454
# Deployment job
4555
deploy:
@@ -52,3 +62,11 @@ jobs:
5262
- name: Deploy to GitHub Pages
5363
id: deployment
5464
uses: actions/deploy-pages@v4
65+
with:
66+
# Add cache control headers
67+
headers: |
68+
Cache-Control: no-cache, no-store, must-revalidate
69+
- name: Purge GitHub Pages cache
70+
run: |
71+
curl -X PURGE ${{ steps.deployment.outputs.page_url }}
72+
echo "Attempted to purge GitHub Pages cache"

0 commit comments

Comments
 (0)