File tree Expand file tree Collapse file tree 2 files changed +70
-0
lines changed Expand file tree Collapse file tree 2 files changed +70
-0
lines changed Original file line number Diff line number Diff line change
1
+ # File: .github/workflows/testNginxForAzureDeploy.yml
2
+
3
+ name : Test Github action to update NGINX for Azure configurations
4
+ on :
5
+ schedule :
6
+ - cron : ' 0 20 * * *'
7
+ push :
8
+
9
+ env :
10
+ NGINX_DEPLOYMENT_NAME : githhubci-test-dep
11
+ NGINX_CONFIG_FILE : test/configs/nginx.conf
12
+ TEST_RESOURCE_GROUP_NAME : testenv-0da38993-workload
13
+
14
+ permissions :
15
+ id-token : write
16
+ contents : read
17
+
18
+ jobs :
19
+ Update-NGINX-Configuration :
20
+ runs-on : ubuntu-latest
21
+ steps :
22
+ - name : ' Checkout repository'
23
+ uses : actions/checkout@v2
24
+ - name : ' Update config'
25
+ shell : bash
26
+ run : |
27
+ sed -i 's/000000/'"$GITHUB_RUN_ID"'/g' $NGINX_CONFIG_FILE
28
+ - name : ' AZ CLI Login'
29
+ uses : azure/login@v1
30
+ with :
31
+ client-id : ${{ secrets.AZURE_CLIENT_ID }}
32
+ tenant-id : ${{ secrets.AZURE_TENANT_ID }}
33
+ subscription-id : ${{ secrets.AZURE_SUBSCRIPTION_ID }}
34
+ - name : ' Sync NGINX configuration to NGINX on Azure instance'
35
+ uses : nginxinc/nginx-for-azure-deploy-action@v0
36
+ with :
37
+ subscription-id : ${{ secrets.AZURE_SUBSCRIPTION_ID }}
38
+ resource-group-name : $TEST_RESOURCE_GROUP_NAME
39
+ nginx-deployment-name : $NGINX_DEPLOYMENT_NAME
40
+ nginx-config-relative-file-path : $NGINX_CONFIG_FILE
41
+ - name : ' Validate config update'
42
+ shell : bash
43
+ run : |
44
+ wget -O - -o /dev/null http://${{ secrets.NGINX_DEPLOYMENT_IP }} | jq '.request.headers."Github-Run-Id" | test( "'"$GITHUB_RUN_ID"'")'
Original file line number Diff line number Diff line change
1
+ http {
2
+ upstream app {
3
+ zone app 64k ;
4
+ least_conn;
5
+ server 10.0.1.4:8000;
6
+ }
7
+
8
+ server {
9
+ listen 80 ;
10
+ server_name *.example.com;
11
+
12
+ location / {
13
+ proxy_set_header Host $host ;
14
+ proxy_set_header X-Real-IP $remote_addr ;
15
+ proxy_set_header X-Proxy-App app;
16
+ proxy_set_header Github-Run-Id 000000 ;
17
+ proxy_buffering on ;
18
+ proxy_buffer_size 4k ;
19
+ proxy_buffers 8 8k ;
20
+ proxy_read_timeout 60s ;
21
+ proxy_pass http://app;
22
+ health_check;
23
+ }
24
+
25
+ }
26
+ }
You can’t perform that action at this time.
0 commit comments