@@ -8,7 +8,37 @@ The following example updates the configuration of a NGINX deployment in Azure e
8
8
9
9
### Sample workflow that authenticates with Azure using Azure Service Principal with a secret
10
10
11
- To be added
11
+ ``` yaml
12
+ # File: .github/workflows/nginxForAzureDeploy.yml
13
+
14
+ name : Sync configuration to NGINX for Azure
15
+ on :
16
+ push :
17
+ branches :
18
+ - main
19
+ paths :
20
+ - config/**
21
+
22
+ jobs :
23
+ Deploy-NGINX-Configuration :
24
+ runs-on : ubuntu-latest
25
+ steps :
26
+ - name : ' Checkout repository'
27
+ uses : actions/checkout@v2
28
+
29
+ - name : ' Run Azure Login with OIDC'
30
+ uses : azure/login@v1
31
+ with :
32
+ creds : ${{ secrets.AZURE_CREDENTIALS }}
33
+
34
+ - name : ' Sync NGINX configuration to NGINX on Azure instance'
35
+ uses : nginxinc/nginx-for-azure-deploy-action@v1
36
+ with :
37
+ subscription-id : ${{ secrets.AZURE_SUBSCRIPTION_ID }}
38
+ resource-group-name : ${{ secrets.AZURE_RESOURCE_GROUP_NAME }}
39
+ nginx-deployment-name : ${{ secrets.NGINX_DEPLOYMENT_NAME }}
40
+ nginx-config-file-path : ${{ secrets.NGINX_CONFIG_FILE }}
41
+ ` ` `
12
42
13
43
### Sample workflow that authenticates with Azure using OIDC
14
44
@@ -27,14 +57,6 @@ permissions:
27
57
id-token : write
28
58
contents : read
29
59
30
- env :
31
- AZURE_TENANT_ID : ' <The Azure Active Directory tenant ID>'
32
- AZURE_CLIENT_ID : ' <The client ID of the Azure Service Principal to perform the deployment>'
33
- AZURE_SUBSCRIPTION_ID : ' <The Azure subscription ID of the NGINX deployment>'
34
- AZURE_RESOURCE_GROUP_NAME : ' <The resource group of the NGINX deployment>'
35
- NGINX_DEPLOYMENT_NAME : ' <The name of the NGINX deployment>'
36
- NGINX_CONFIG_FILE : ' <The relative path of the configuration file in the repository>'
37
-
38
60
jobs :
39
61
Deploy-NGINX-Configuration :
40
62
runs-on : ubuntu-latest
@@ -45,14 +67,15 @@ jobs:
45
67
- name : ' Run Azure Login with OIDC'
46
68
uses : azure/login@v1
47
69
with :
48
- client-id : ${{ env .AZURE_CLIENT_ID }}
49
- tenant-id : ${{ env .AZURE_TENANT_ID }}
50
- subscription-id : ${{ env .AZURE_SUBSCRIPTION_ID }}
70
+ client-id : ${{ secrets .AZURE_CLIENT_ID }}
71
+ tenant-id : ${{ secrets .AZURE_TENANT_ID }}
72
+ subscription-id : ${{ secrets .AZURE_SUBSCRIPTION_ID }}
51
73
52
74
- name : ' Sync NGINX configuration to NGINX on Azure instance'
53
75
uses : nginxinc/nginx-for-azure-deploy-action@v1
54
76
with :
55
- subscription-id : ${{ env.AZURE_SUBSCRIPTION_ID }}
56
- resource-group-name : ${{ env.AZURE_RESOURCE_GROUP_NAME }}
57
- nginx-deployment-name : ${{ env.NGINX_DEPLOYMENT_NAME }}
58
- nginx-config-file-path : ${{ env.NGINX_CONFIG_FILE }}
77
+ subscription-id : ${{ secrets.AZURE_SUBSCRIPTION_ID }}
78
+ resource-group-name : ${{ secrets.AZURE_RESOURCE_GROUP_NAME }}
79
+ nginx-deployment-name : ${{ secrets.NGINX_DEPLOYMENT_NAME }}
80
+ nginx-config-file-path : ${{ secrets.NGINX_CONFIG_FILE }}
81
+ ` ` `
0 commit comments