Skip to content

Commit 1669bcf

Browse files
committed
Add rule to allow github runner IP to longevity deployment security group
1 parent 50e00c5 commit 1669bcf

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
@@ -9,6 +9,7 @@ env:
99
NGINX_TRANSFORMED_CONFIG_DIR_PATH: /etc/nginx/
1010
NGINX_ROOT_CONFIG_FILE: nginx.conf
1111
TEST_RESOURCE_GROUP_NAME: n4a-long-eastus2-workload
12+
TEST_SECURITY_GROUP_NAME: n4a-long-eastus2-workload-pub
1213
NGINX_CERT_NAME: n4a-long-eastus2-basic-crt
1314
NGINX_VAULT_NAME: nlbtest-customer
1415

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

0 commit comments

Comments
 (0)