supabase-postgres.git / summary / log / commit / refs

commit    ea1ebd1789a13368035da4ee7ce788cacaf4d9cf
Author:   Sam Rose <samuel@supabase.io>
Commit:   Div Arora <darora@users.noreply.github.com>
Date:     Sat Aug 17 16:32:51 2024 +0000

    fix: make sure that ec2 is cleaned up in all cases of flow end


.github/workflows/ami-release-nix.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/ami-release-nix.yml b/.github/workflows/ami-release-nix.yml index d500af73..3b5430dd 100644 --- a/.github/workflows/ami-release-nix.yml +++ b/.github/workflows/ami-release-nix.yml @@ -129,6 +129,11 @@ jobs: SLACK_MESSAGE: 'Building Postgres AMI failed' SLACK_FOOTER: '' + - name: Cleanup resources on build cancellation + if: ${{ always() }} + run: | + aws ec2 describe-instances --filters "Name=tag:packerExecutionId,Values=${GITHUB_RUN_ID}" --query "Reservations[].Instances[].InstanceId" --output text | xargs -n 1 -I {} aws ec2 terminate-instances --instance-ids {} + - name: Cleanup resources on build cancellation if: ${{ cancelled() }} run: | [parent: 86687f8c6aa5]