From 81ac51969362e2859bf30dd1b1fac78847c887e3 Mon Sep 17 00:00:00 2001 From: bescka <126282728+bescka@users.noreply.github.com> Date: Thu, 1 Aug 2024 18:10:02 +0100 Subject: [PATCH] workflow - runner whitelist and sleep --- .github/workflows/deploy_on_push.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/deploy_on_push.yml b/.github/workflows/deploy_on_push.yml index 4283c00c..e475069d 100644 --- a/.github/workflows/deploy_on_push.yml +++ b/.github/workflows/deploy_on_push.yml @@ -29,6 +29,9 @@ jobs: --port 22 \ --cidr ${{ steps.ip.outputs.ipv4 }}/32 + - name: Wait for security group update to propagate + run: sleep 30 + - name: Checkout repository uses: actions/checkout@v4 @@ -111,3 +114,11 @@ jobs: echo "Cleaning up SSH keys..." rm -rf ~/.ssh/id_ed25519 echo "SSH keys cleaned up." + + - name: revoke runner ip address + run: | + aws ec2 revoke-security-group-ingress \ + --group-id $AWS_INSTANCE_SG_ID \ + --protocol tcp \ + --port 22 \ + --cidr ${{ steps.ip.outputs.ipv4 }}/32