Skip to content

Commit af1c431

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

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

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

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
name: Test Github action to update NGINX as a Service (NGINXaaS) for Azure configurations
44
on:
5+
workflow_dispatch
56
schedule:
67
- cron: "0 20 * * *"
78

@@ -10,6 +11,7 @@ env:
1011
NGINX_TRANSFORMED_CONFIG_DIR_PATH: /etc/nginx/
1112
NGINX_ROOT_CONFIG_FILE: nginx.conf
1213
TEST_RESOURCE_GROUP_NAME: n4a-long-eastus2-workload
14+
TEST_SECURITY_GROUP_NAME: n4a-long-eastus2-workload-pub
1315
NGINX_CERT_NAME: n4a-long-eastus2-basic-crt
1416
NGINX_VAULT_NAME: nlbtest-customer
1517

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

0 commit comments

Comments
 (0)