Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/github-action-test-nginxaas-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
sed -i 's/000000/'"$GITHUB_RUN_ID"'/g' github-action/test/configs/single/nginx.conf
cat github-action/test/configs/single/nginx.conf
- name: "Sync NGINX configuration to NGINXaaS for Azure - single file"
uses: nginxinc/nginx-for-azure-deploy-action@v0.3.1
uses: nginxinc/nginx-for-azure-deploy-action/github-action@v0.4.0
with:
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
resource-group-name: $TEST_RESOURCE_GROUP_NAME
Expand All @@ -56,7 +56,7 @@ jobs:
sed -i 's/000000/'"$GITHUB_RUN_ID"'/g' github-action/test/configs/multi/conf.d/proxy.conf
cat github-action/test/configs/multi/conf.d/proxy.conf
- name: "Sync NGINX configuration and certificate to NGINXaaS for Azure - multi file"
uses: nginxinc/nginx-for-azure-deploy-action@v0.3.1
uses: nginxinc/nginx-for-azure-deploy-action/github-action@v0.4.0
with:
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
resource-group-name: $TEST_RESOURCE_GROUP_NAME
Expand Down
18 changes: 12 additions & 6 deletions github-action/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,15 @@ jobs:
creds: ${{ secrets.AZURE_CREDENTIALS }}

- name: 'Sync the NGINX configuration from the GitHub repository to the NGINXaaS for Azure deployment'
uses: nginxinc/nginx-for-azure-deploy-action@v0.3.1
uses: nginxinc/nginx-for-azure-deploy-action/github-action@v0.4.0
with:
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
resource-group-name: ${{ secrets.AZURE_RESOURCE_GROUP_NAME }}
nginx-deployment-name: ${{ secrets.NGINX_DEPLOYMENT_NAME }}
nginx-config-directory-path: config/
nginx-root-config-file: nginx.conf
transformed-nginx-config-directory-path: /etc/nginx/
debug: false
```

### Sample workflow that authenticates with Azure using OIDC
Expand Down Expand Up @@ -76,14 +77,15 @@ jobs:
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

- name: 'Sync the NGINX configuration from the GitHub repository to the NGINXaaS for Azure deployment'
uses: nginxinc/nginx-for-azure-deploy-action@v0.3.1
uses: nginxinc/nginx-for-azure-deploy-action/github-action@v0.4.0
with:
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
resource-group-name: ${{ secrets.AZURE_RESOURCE_GROUP_NAME }}
nginx-deployment-name: ${{ secrets.NGINX_DEPLOYMENT_NAME }}
nginx-config-directory-path: config/
nginx-root-config-file: nginx.conf
transformed-nginx-config-directory-path: /etc/nginx/
debug: false
```

> **Note:**
Expand All @@ -104,13 +106,14 @@ To use this action to sync the configuration files from this example, the direct

```yaml
- name: 'Sync the NGINX configuration from the GitHub repository to the NGINXaaS for Azure deployment'
uses: nginxinc/nginx-for-azure-deploy-action@v0.3.1
uses: nginxinc/nginx-for-azure-deploy-action/github-action@v0.4.0
with:
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
resource-group-name: ${{ secrets.AZURE_RESOURCE_GROUP_NAME }}
nginx-deployment-name: ${{ secrets.NGINX_DEPLOYMENT_NAME }}
nginx-config-directory-path: config/
nginx-root-config-file: nginx.conf
debug: false
```

By default, the action uses a file's relative path to `nginx-config-directory-path` in the repository as the file path in the NGINXaaS for Azure deployment.
Expand All @@ -136,14 +139,15 @@ The action supports an optional input `transformed-nginx-config-directory-path`

```yaml
- name: 'Sync the NGINX configuration from the Git repository to the NGINXaaS for Azure deployment'
uses: nginxinc/nginx-for-azure-deploy-action@v0.3.1
uses: nginxinc/nginx-for-azure-deploy-action/github-action@v0.4.0
with:
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
resource-group-name: ${{ secrets.AZURE_RESOURCE_GROUP_NAME }}
nginx-deployment-name: ${{ secrets.NGINX_DEPLOYMENT_NAME }}
nginx-config-directory-path: config/
nginx-root-config-file: nginx.conf
transformed-nginx-config-directory-path: /etc/nginx/
debug: false
```
The transformed paths of the two configuration files in the NGINXaaS for Azure deployment are summarized in the following table

Expand All @@ -168,20 +172,21 @@ See the example below

```yaml
- name: "Sync NGINX certificates to NGINXaaS for Azure"
uses: nginxinc/nginx-for-azure-deploy-action@v0.3.1
uses: nginxinc/nginx-for-azure-deploy-action/github-action@v0.4.0
with:
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
resource-group-name: ${{ secrets.AZURE_RESOURCE_GROUP_NAME }}
nginx-deployment-name: ${{ secrets.NGINX_DEPLOYMENT_NAME }}
nginx-deployment-location: ${{ secrets.NGINX_DEPLOYMENT_LOCATION }}
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" } ]'
debug: false
```

## Handling NGINX configuration and certificates

```yaml
- name: "Sync NGINX configuration- multi file and certificate to NGINXaaS for Azure"
uses: nginxinc/nginx-for-azure-deploy-action@v0.3.1
uses: nginxinc/nginx-for-azure-deploy-action/github-action@v0.4.0
with:
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
resource-group-name: ${{ secrets.AZURE_RESOURCE_GROUP_NAME }}
Expand All @@ -191,4 +196,5 @@ See the example below
nginx-root-config-file: nginx.conf
transformed-nginx-config-directory-path: /etc/nginx/
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" } ]'
debug: false
```