fix cf-pages cleanup

This commit is contained in:
2025-06-19 12:48:10 +09:00
parent b34918bb29
commit 5d7cf7cc5d

View File

@@ -110,18 +110,18 @@ jobs:
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
wranglerVersion: '3'
cleanup:
needs: deploy
runs-on: ubuntu-latest
if: success()
steps:
- name: Cleanup old deployments
run: |
curl -X PATCH \
"https://api.cloudflare.com/client/v4/accounts/${{ secrets.CLOUDFLARE_ACCOUNT_ID }}/pages/projects/${{ secrets.CLOUDFLARE_PROJECT_NAME }} \
-H "Authorization: Bearer ${{ secrets.CLOUDFLARE_API_TOKEN }}" \
-H "Content-Type: application/json")
-d "{ \"deployment_configs\": { \"production\": { \"deployment_retention\": ${{ env.KEEP_DEPLOYMENTS }} } } }"
# cleanup:
# needs: deploy
# runs-on: ubuntu-latest
# if: success()
# steps:
# - name: Cleanup old deployments
# run: |
# curl -X PATCH \
# "https://api.cloudflare.com/client/v4/accounts/${{ secrets.CLOUDFLARE_ACCOUNT_ID }}/pages/projects/${{ secrets.CLOUDFLARE_PROJECT_NAME }} \
# -H "Authorization: Bearer ${{ secrets.CLOUDFLARE_API_TOKEN }}" \
# -H "Content-Type: application/json")
# -d "{ \"deployment_configs\": { \"production\": { \"deployment_retention\": ${{ env.KEEP_DEPLOYMENTS }} } } }"
# # Get all deployments
# DEPLOYMENTS=$(curl -s -X GET \
# "https://api.cloudflare.com/client/v4/accounts/${{ secrets.CLOUDFLARE_ACCOUNT_ID }}/pages/projects/${{ secrets.CLOUDFLARE_PROJECT_NAME }}/deployments" \