Skip to content

Commit ad5d922

Browse files
committed
Add rule to allow github runner IP to longevity deployment security group
1 parent a99a7aa commit ad5d922

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

.github/workflows/github-action-test-nginxaas-deploy.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ env:
1010
NGINX_TRANSFORMED_CONFIG_DIR_PATH: /etc/nginx/
1111
NGINX_ROOT_CONFIG_FILE: nginx.conf
1212
TEST_RESOURCE_GROUP_NAME: n4a-long-eastus2-workload
13+
TEST_SECURITY_GROUP_NAME: n4a-long-eastus2-workload-pub
1314
NGINX_CERT_NAME: n4a-long-eastus2-basic-crt
1415
NGINX_VAULT_NAME: nlbtest-customer
1516

@@ -29,7 +30,24 @@ jobs:
2930
client-id: ${{ secrets.AZURE_CLIENT_ID }}
3031
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
3132
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
32-
33+
- name: get runner ip addresses
34+
id: ip
35+
uses: haythem/public-ip@v1.3
36+
- name: allow runner ip access to the longivity deployment
37+
shell: bash
38+
run: |
39+
az network nsg rule create \
40+
--resource-group "$TEST_RESOURCE_GROUP_NAME"\
41+
--nsg-name "$TEST_SECURITY_GROUP_NAME"\
42+
--name allow_github_runner_access \
43+
--priority 1003 \
44+
--direction Inbound \
45+
--access Allow \
46+
--protocol Tcp \
47+
--source-address-prefixes "${{ steps.ip.outputs.ipv4 }}/32" \
48+
--source-port-ranges "*" \
49+
--destination-address-prefixes "*" \
50+
--destination-port-ranges 80 443
3351
- name: "Update config - single file"
3452
shell: bash
3553
run: |

0 commit comments

Comments
 (0)