-
Notifications
You must be signed in to change notification settings - Fork 11
36 lines (32 loc) · 1.23 KB
/
delete-release-env.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Delete release environment
on: delete
jobs:
delete-release-env:
if: github.event.ref_type == 'branch' && contains(github.event.ref, 'release')
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
pull-requests: read
steps:
- uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b
- uses: unfor19/install-aws-cli-action@v1
with:
version: 2
- name: Install kubectl
uses: azure/setup-kubectl@901a10e89ea615cf61f57ac05cecdf23e7de06d8 #v3.2
with:
version: "v1.25.6"
- name: Configure AWS credentials for deployment
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ secrets.DEPLOY_RELEASES_IAM_ROLE }}
aws-region: eu-west-2
- name: Delete PR
run: |
aws eks update-kubeconfig --name ${{ secrets.CLUSTER_NAME }} \
--alias ${{ secrets.CLUSTER_NAME }} \
--region eu-west-2
BRANCH_NAME=${{ github.ref_name }}
NORMALIZED_BRANCH_NAME=${BRANCH_NAME/\//-}
kubectl delete subns radix-dapp-toolkit-$NORMALIZED_BRANCH_NAME -n radix-dapp-toolkit-ci-releases