|
| 1 | +# Table of contents |
| 2 | +1. [docs-actions](#docs-actions) |
| 3 | +1. [Hugo theme version](#hugo-theme-version) |
| 4 | +1. [az-sync-action](#az-sync-action) |
| 5 | + |
| 6 | + |
1 | 7 | # docs-actions |
2 | 8 |
|
3 | 9 | This repo contains actions for building and deploying, hugo and sphinx based documentation websites for NGINX. |
|
140 | 146 | paths: |
141 | 147 | - docsDirectory/** |
142 | 148 | ....... |
| 149 | +``` |
| 150 | + |
| 151 | +# az-sync action |
| 152 | + |
| 153 | +**Path:** `.github/actions/az-sync/action.yml` |
| 154 | + |
| 155 | +A reusable composite action written by s.breen that logs into Azure, retrieves secrets from an Azure Key Vault, and exports them as environment variables for use in subsequent workflow steps. After all secrets are synced, it logs out of Azure automatically. |
| 156 | + |
| 157 | +## Inputs |
| 158 | + |
| 159 | +| Input | Description | Required | Default | |
| 160 | +|---|---|---|---| |
| 161 | +| `az_client_id` | Azure Client ID (for OIDC federated login) | Yes | — | |
| 162 | +| `az_tenant_id` | Azure Tenant ID | Yes | — | |
| 163 | +| `az_subscription_id` | Azure Subscription ID | Yes | — | |
| 164 | +| `keyvault` | Name of the Azure Key Vault to read secrets from | Yes | — | |
| 165 | +| `secrets-filter` | Comma-separated list (no spaces) of secret name patterns to sync | Yes | `*` | |
| 166 | + |
| 167 | +## Usage example |
| 168 | + |
| 169 | +```yml |
| 170 | +- name: Get Secrets from Azure Key Vault |
| 171 | + # Always use full path while adding into called workflow |
| 172 | + uses: nginxinc/docs-actions/.github/actions/az-sync |
| 173 | + with: |
| 174 | + az_client_id: ${{ secrets.AZURE_VAULT_CLIENT_ID }} |
| 175 | + az_tenant_id: ${{ secrets.AZURE_VAULT_TENANT_ID }} |
| 176 | + az_subscription_id: ${{ secrets.AZURE_VAULT_SUBSCRIPTION_ID }} |
| 177 | + keyvault: ${{ secrets.DOCS_VAULTNAME }} |
| 178 | + secrets-filter: 'MySecret1,MySecret2' |
| 179 | +
|
| 180 | +- name: Using secrets |
| 181 | + env: |
| 182 | + MySecret1: ${{ env.MySecret1 }} |
| 183 | + MySecret2: ${{ env.MySecret2 }} |
| 184 | + run: | |
| 185 | + ... |
| 186 | +
|
| 187 | +- name: Configure AWS credentials via OIDC (assume role) |
| 188 | + uses: aws-actions/configure-aws-credentials@v4 |
| 189 | + with: |
| 190 | + role-to-assume: arn:aws:iam::${{ env.MySecret1 }}:role/${{ env.MySecret1 }} |
| 191 | + aws-region: eu-central-1 |
| 192 | +``` |
| 193 | + |
| 194 | +Each matched secret is exported as an environment variable named after the secret (e.g. `MySecret1`). Multiline secret values are handled using the heredoc syntax supported by `$GITHUB_ENV`. |
| 195 | + |
| 196 | +--- |
| 197 | + |
0 commit comments