Skip to content

Commit 8da7154

Browse files
authored
Merge pull request #24 from george-ngugi/george/readme
Update readme
2 parents f5088f5 + 4a198dd commit 8da7154

File tree

1 file changed

+47
-5
lines changed

1 file changed

+47
-5
lines changed

README.md

Lines changed: 47 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# NGINX for Azure Deployment Action
22

3-
This action supports managing the configuration of an [NGINX for Azure](https://docs.nginx.com/nginx-for-azure/quickstart/overview/) deployment in a GitHub repository. It enables continuous deployment through GitHub workflows to automatically update the NGINX for Azure deployment when changes are made to the NGINX configuration files stored in the respository.
3+
This action supports managing the configuration of an [NGINX for Azure](https://docs.nginx.com/nginx-for-azure/quickstart/overview/) deployment in a GitHub repository. It enables continuous deployment through GitHub workflows to automatically update the NGINX for Azure deployment when changes are made to the NGINX configuration files stored in the respository. Additionally, one can update NGINX certificates that are already present in Azure key vault.
44

55
## Connecting to Azure
66

@@ -34,7 +34,7 @@ jobs:
3434
creds: ${{ secrets.AZURE_CREDENTIALS }}
3535

3636
- name: 'Sync the NGINX configuration from the GitHub repository to the NGINX for Azure deployment'
37-
uses: nginxinc/nginx-for-azure-deploy-action@v0.1.0
37+
uses: nginxinc/nginx-for-azure-deploy-action@v0.3.0
3838
with:
3939
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
4040
resource-group-name: ${{ secrets.AZURE_RESOURCE_GROUP_NAME }}
@@ -76,7 +76,7 @@ jobs:
7676
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
7777

7878
- name: 'Sync the NGINX configuration from the GitHub repository to the NGINX for Azure deployment'
79-
uses: nginxinc/nginx-for-azure-deploy-action@v0.1.0
79+
uses: nginxinc/nginx-for-azure-deploy-action@v0.3.0
8080
with:
8181
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
8282
resource-group-name: ${{ secrets.AZURE_RESOURCE_GROUP_NAME }}
@@ -85,6 +85,7 @@ jobs:
8585
nginx-root-config-file: nginx.conf
8686
transformed-nginx-config-directory-path: /etc/nginx/
8787
```
88+
8889
## Handling NGINX configuration file paths
8990
9091
To facilitate the migration of the existing NGINX configuration, NGINX for Azure supports multiple-files configuration with each file uniquely identified by a file path, just like how NGINX configuration files are created and used in a self-hosting machine. An NGINX configuration file can include another file using the [include directive](https://docs.nginx.com/nginx/admin-guide/basic-functionality/managing-configuration-files/). The file path used in an `include` directive can either be an absolute path or a relative path to the [prefix path](https://www.nginx.com/resources/wiki/start/topics/tutorials/installoptions/).
@@ -100,7 +101,7 @@ To use this action to sync the configuration files from this example, the direct
100101

101102
```yaml
102103
- name: 'Sync the NGINX configuration from the GitHub repository to the NGINX for Azure deployment'
103-
uses: nginxinc/nginx-for-azure-deploy-action@v0.1.0
104+
uses: nginxinc/nginx-for-azure-deploy-action@v0.3.0
104105
with:
105106
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
106107
resource-group-name: ${{ secrets.AZURE_RESOURCE_GROUP_NAME }}
@@ -132,7 +133,7 @@ The action supports an optional input `transformed-nginx-config-directory-path`
132133

133134
```yaml
134135
- name: 'Sync the NGINX configuration from the Git repository to the NGINX for Azure deployment'
135-
uses: nginxinc/nginx-for-azure-deploy-action@v0.1.0
136+
uses: nginxinc/nginx-for-azure-deploy-action@v0.3.0
136137
with:
137138
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
138139
resource-group-name: ${{ secrets.AZURE_RESOURCE_GROUP_NAME }}
@@ -147,3 +148,44 @@ The transformed paths of the two configuration files in the NGINX for Azure depl
147148
|--------------------------------------|-----------------------------------|---------------------------------------------|
148149
| /etc/nginx/nginx.conf | /config/nginx.conf | /etc/nginx/nginx.conf |
149150
| /etc/nginx/sites-enabled/mysite.conf | /config/sites-enabled/mysite.conf | /etc/nginx/sites-enabled/mysite.conf |
151+
152+
## Handling NGINX certificates
153+
154+
Since certificates are secrets, it is assumed they are stored in Azure key vault. One can provide multiple certificate entries to the github action as an array of JSON objects with keys:
155+
156+
`certificateName`- A unique name for the certificate entry
157+
158+
`keyvaultSecret`- The secret ID for the certificate on Azure key vault
159+
160+
`certificateVirtualPath`- This path must match one or more ssl_certificate directive file arguments in your Nginx configuration; and must be unique between certificates within the same deployment
161+
162+
`keyVirtualPath`- This path must match one or more ssl_certificate_key directive file arguments in your Nginx configuration; and must be unique between certificates within the same deployment
163+
164+
See the example below
165+
166+
```yaml
167+
- name: "Sync NGINX certificates to NGINX for Azure"
168+
uses: nginxinc/[email protected]
169+
with:
170+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
171+
resource-group-name: ${{ secrets.AZURE_RESOURCE_GROUP_NAME }}
172+
nginx-deployment-name: ${{ secrets.NGINX_DEPLOYMENT_NAME }}
173+
nginx-deployment-location: ${{ secrets.NGINX_DEPLOYMENT_LOCATION }}
174+
nginx-certificates: '[{"certificateName": "$NGINX_CERT_NAME", "keyvaultSecret": "https://$NGINX_VAULT_NAME.vault.azure.net/secrets/$NGINX_CERT_NAME", "certificateVirtualPath": "/etc/nginx/ssl/my-cert.crt", "keyVirtualPath": "/etc/nginx/ssl/my-cert.key" } ]'
175+
```
176+
177+
## Handling NGINX configuration and certificates
178+
179+
```yaml
180+
- name: "Sync NGINX configuration- multi file and certificate to NGINX for Azure"
181+
uses: nginxinc/[email protected]
182+
with:
183+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
184+
resource-group-name: ${{ secrets.AZURE_RESOURCE_GROUP_NAME }}
185+
nginx-deployment-name: ${{ secrets.NGINX_DEPLOYMENT_NAME }}
186+
nginx-deployment-location: ${{ secrets.NGINX_DEPLOYMENT_LOCATION }}
187+
nginx-config-directory-path: config/
188+
nginx-root-config-file: nginx.conf
189+
transformed-nginx-config-directory-path: /etc/nginx/
190+
nginx-certificates: '[{"certificateName": "$NGINX_CERT_NAME", "keyvaultSecret": "https://$NGINX_VAULT_NAME.vault.azure.net/secrets/$NGINX_CERT_NAME", "certificateVirtualPath": "/etc/nginx/ssl/my-cert.crt", "keyVirtualPath": "/etc/nginx/ssl/my-cert.key" } ]'
191+
```

0 commit comments

Comments
 (0)