Skip to content

Commit b47bd7c

Browse files
authored
ci: implement automatic upgrade of PR deployment (#8876)
1 parent d3991fa commit b47bd7c

File tree

4 files changed

+171
-84
lines changed

4 files changed

+171
-84
lines changed

.github/workflows/pr-cleanup.yaml

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Cleanup PR deployment and image
22
on:
33
pull_request:
4-
types: [closed]
4+
types: closed
55
workflow_dispatch:
66
inputs:
77
pr_number:
@@ -63,5 +63,11 @@ jobs:
6363
(
6464
curl -X DELETE "https://api.cloudflare.com/client/v4/zones/${{ secrets.PR_DEPLOYMENTS_ZONE_ID }}/dns_records/$record_id" \
6565
-H "Authorization: Bearer ${{ secrets.PR_DEPLOYMENTS_CLOUDFLARE_API_TOKEN }}" \
66-
-H "Content-Type:application/json"
66+
-H "Content-Type:application/json" | jq -r '.success'
6767
) || echo "DNS record not found"
68+
69+
- name: "Delete certificate"
70+
if: ${{ github.event.pull_request.merged == true }}
71+
run: |
72+
set -euxo pipefail
73+
kuebctl delete certificate "pr${{ steps.pr_number.outputs.PR_NUMBER }}-tls" -n pr-deployment-certs || echo "certificate not found"

0 commit comments

Comments
 (0)