Add Cloudflare Pages cache headers for static assets (gitea/docs#473)

Co-authored-by: Lunny Xiao <[email protected]>
This commit is contained in:
Lunny Xiao
2026-07-27 20:30:17 +00:00
committed by techknowlogick
parent 9f3bb6cc19
commit 31c6782d0c
2 changed files with 52 additions and 0 deletions
+7
View File
@@ -46,6 +46,13 @@ jobs:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
run: |
# cloudflare/_headers is only meaningful for the Cloudflare Pages
# deployment, so it is copied into build/ here, after the S3 sync
# step above has already run. If it were placed in build/ any
# earlier, that S3 sync would publish it to S3/CloudFront and make
# it publicly accessible at /_headers there.
cp cloudflare/_headers build/_headers
test -f build/_headers || exit 1
pnpm dlx wrangler@4 pages deploy build \
--project-name docs-gitea-com \
--branch main