Skip to content

Delete release environment #30

Delete release environment

Delete release environment #30

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