7
7
8
8
env :
9
9
NGINX_DEPLOYMENT_NAME : githhubci-test-dep
10
- NGINX_CONFIG_FILE : test/configs/nginx.conf
10
+ NGINX_TRANSFORMED_CONFIG_DIR_PATH : /etc/nginx/
11
+ NGINX_ROOT_CONFIG_FILE : nginx.conf
11
12
TEST_RESOURCE_GROUP_NAME : testenv-0da38993-workload
12
13
13
14
permissions :
@@ -20,23 +21,43 @@ jobs:
20
21
steps :
21
22
- name : ' Checkout repository'
22
23
uses : actions/checkout@v2
23
- - name : ' Update config'
24
- shell : bash
25
- run : |
26
- sed -i 's/000000/'"$GITHUB_RUN_ID"'/g' $NGINX_CONFIG_FILE
27
24
- name : ' AZ CLI Login'
28
25
uses : azure/login@v1
29
26
with :
30
27
client-id : ${{ secrets.AZURE_CLIENT_ID }}
31
28
tenant-id : ${{ secrets.AZURE_TENANT_ID }}
32
29
subscription-id : ${{ secrets.AZURE_SUBSCRIPTION_ID }}
33
- - name : ' Sync NGINX configuration to NGINX on Azure instance'
30
+ - name : ' Update config - single file'
31
+ shell : bash
32
+ run : |
33
+ echo "RANDOM=$((RANDOM%10))" >> $GITHUB_ENV
34
+ sed -i 's/000000/'"${ env.RANDOM }"'/g' tests/configs/single/nginx.conf
35
+ - name : ' Sync NGINX configuration to NGINX on Azure instance - single file'
36
+ uses : nginxinc/nginx-for-azure-deploy-action@v0
37
+ with :
38
+ subscription-id : ${{ secrets.AZURE_SUBSCRIPTION_ID }}
39
+ resource-group-name : $TEST_RESOURCE_GROUP_NAME
40
+ nginx-deployment-name : $NGINX_DEPLOYMENT_NAME
41
+ nginx-config-directory-path : tests/configs/single/
42
+ nginx-root-config-file : $NGINX_ROOT_CONFIG_FILE
43
+ transformed-nginx-config-directory-path : $NGINX_TRANSFORMED_CONFIG_DIR_PATH
44
+ - name : ' Validate config update - single file'
45
+ shell : bash
46
+ run : |
47
+ wget -O - -o /dev/null http://${{ secrets.NGINX_DEPLOYMENT_IP }} | jq '.request.headers."Github-Run-Id" | test( "'"${ env.RANDOM }"'")'
48
+ - name : ' Update config - multi file'
49
+ shell : bash
50
+ run : |
51
+ sed -i 's/000000/'"$GITHUB_RUN_ID"'/g' tests/configs/multi/conf.d/proxy.conf
52
+ - name : ' Sync NGINX configuration to NGINX on Azure instance - multi file'
34
53
uses : nginxinc/nginx-for-azure-deploy-action@v0
35
54
with :
36
55
subscription-id : ${{ secrets.AZURE_SUBSCRIPTION_ID }}
37
56
resource-group-name : $TEST_RESOURCE_GROUP_NAME
38
57
nginx-deployment-name : $NGINX_DEPLOYMENT_NAME
39
- nginx-config-relative-file-path : $NGINX_CONFIG_FILE
58
+ nginx-config-directory-path : tests/configs/multi/
59
+ nginx-root-config-file : $NGINX_ROOT_CONFIG_FILE
60
+ transformed-nginx-config-directory-path : $NGINX_TRANSFORMED_CONFIG_DIR_PATH
40
61
- name : ' Validate config update'
41
62
shell : bash
42
63
run : |
0 commit comments