diff --git a/.github/workflows/build-and-push-image.yml b/.github/workflows/build-and-push-image.yml index 97b3ef1..154c4e7 100644 --- a/.github/workflows/build-and-push-image.yml +++ b/.github/workflows/build-and-push-image.yml @@ -91,3 +91,21 @@ jobs: } catch (error) { core.setFailed(error.message); } + + - name: Trigger Build and Push NuGet Package workflow + uses: "actions/github-script@v7" + if: needs.set-env.outputs.environment == 'production' + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + script: | + const tagName = "${{ needs.set-env.outputs.release }}" + console.log("Triggering Build and Push NuGet Package workflow with tag:", tagName); + github.rest.actions.createWorkflowDispatch({ + owner: context.repo.owner, + repo: context.repo.repo, + workflow_id: "build-and-push-package.yml", + ref: "main", + inputs: { + tag_name: tagName + } + }); \ No newline at end of file diff --git a/.github/workflows/build-and-push-package.yml b/.github/workflows/build-and-push-package.yml index 71a8115..012b65b 100644 --- a/.github/workflows/build-and-push-package.yml +++ b/.github/workflows/build-and-push-package.yml @@ -1,9 +1,11 @@ name: Build and Push NuGet Package on: - push: - tags: - - 'production-*' + workflow_dispatch: + inputs: + tag_name: + description: "The production tag name to process" + required: true env: DOTNET_VERSION: '8.0.x' @@ -14,11 +16,14 @@ jobs: permissions: packages: write contents: write + if: startsWith(github.event.inputs.tag_name, 'production-') + steps: - - uses: actions/checkout@v4 + - name: Check Out Tag + uses: actions/checkout@v4 with: - ref: ${{ github.ref }} - fetch-depth: 0 # Shallow clones disabled for a better relevancy of SC analysis + ref: ${{ github.event.inputs.tag_name }} + fetch-depth: 0 # Ensure full history and tags are available - name: Setup .NET uses: actions/setup-dotnet@v4 @@ -81,7 +86,7 @@ jobs: shell: /usr/bin/bash -e {0} - name: Build, pack and publish - working-directory: Dfe.PersonsApi.Client + working-directory: src/Dfe.PersonsApi.Client run: | dotnet build -c Release dotnet pack -c Release -p:PackageVersion=${{ env.NEW_VERSION }} --output . diff --git a/terraform/README.md b/terraform/README.md index d5cf437..25fe8bd 100644 --- a/terraform/README.md +++ b/terraform/README.md @@ -137,7 +137,7 @@ No providers. | Name | Source | Version | |------|--------|---------| -| [azure\_container\_apps\_hosting](#module\_azure\_container\_apps\_hosting) | github.com/DFE-Digital/terraform-azurerm-container-apps-hosting | v1.16.4 | +| [azure\_container\_apps\_hosting](#module\_azure\_container\_apps\_hosting) | github.com/DFE-Digital/terraform-azurerm-container-apps-hosting | v1.16.6 | | [azurerm\_key\_vault](#module\_azurerm\_key\_vault) | github.com/DFE-Digital/terraform-azurerm-key-vault-tfvars | v0.5.1 | | [statuscake-tls-monitor](#module\_statuscake-tls-monitor) | github.com/dfe-digital/terraform-statuscake-tls-monitor | v0.1.5 | @@ -198,6 +198,7 @@ No resources. | [key\_vault\_access\_ipv4](#input\_key\_vault\_access\_ipv4) | List of IPv4 Addresses that are permitted to access the Key Vault | `list(string)` | n/a | yes | | [monitor\_email\_receivers](#input\_monitor\_email\_receivers) | A list of email addresses that should be notified by monitoring alerts | `list(string)` | n/a | yes | | [monitor\_endpoint\_healthcheck](#input\_monitor\_endpoint\_healthcheck) | Specify a route that should be monitored for a 200 OK status | `string` | n/a | yes | +| [monitor\_http\_availability\_verb](#input\_monitor\_http\_availability\_verb) | Which HTTP verb to use for the HTTP Availability check | `string` | `"GET"` | no | | [project\_name](#input\_project\_name) | Project name. Will be used along with `environment` as a prefix for all resources. | `string` | n/a | yes | | [registry\_admin\_enabled](#input\_registry\_admin\_enabled) | Do you want to enable access key based authentication for your Container Registry? | `bool` | `true` | no | | [registry\_managed\_identity\_assign\_role](#input\_registry\_managed\_identity\_assign\_role) | Assign the 'AcrPull' Role to the Container App User-Assigned Managed Identity. Note: If you do not have 'Microsoft.Authorization/roleAssignments/write' permission, you will need to manually assign the 'AcrPull' Role to the identity | `bool` | `false` | no | diff --git a/terraform/container-apps-hosting.tf b/terraform/container-apps-hosting.tf index a132d20..e3a29ac 100644 --- a/terraform/container-apps-hosting.tf +++ b/terraform/container-apps-hosting.tf @@ -1,5 +1,5 @@ module "azure_container_apps_hosting" { - source = "github.com/DFE-Digital/terraform-azurerm-container-apps-hosting?ref=v1.16.4" + source = "github.com/DFE-Digital/terraform-azurerm-container-apps-hosting?ref=v1.16.6" environment = local.environment project_name = local.project_name @@ -60,4 +60,5 @@ module "azure_container_apps_hosting" { cdn_frontdoor_health_probe_path = local.cdn_frontdoor_health_probe_path monitor_endpoint_healthcheck = local.monitor_endpoint_healthcheck existing_logic_app_workflow = local.existing_logic_app_workflow + monitor_http_availability_verb = local.monitor_http_availability_verb } diff --git a/terraform/locals.tf b/terraform/locals.tf index c227c71..6663881 100644 --- a/terraform/locals.tf +++ b/terraform/locals.tf @@ -55,4 +55,5 @@ locals { health_insights_api_ipv4_allow_list = var.health_insights_api_ipv4_allow_list enable_cdn_frontdoor_vdp_redirects = var.enable_cdn_frontdoor_vdp_redirects cdn_frontdoor_vdp_destination_hostname = var.cdn_frontdoor_vdp_destination_hostname + monitor_http_availability_verb = var.monitor_http_availability_verb } diff --git a/terraform/variables.tf b/terraform/variables.tf index 4ddaf08..8f2ded9 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -375,3 +375,9 @@ variable "existing_resource_group" { description = "Conditionally launch resources into an existing resource group. Specifying this will NOT create a resource group." type = string } + +variable "monitor_http_availability_verb" { + description = "Which HTTP verb to use for the HTTP Availability check" + type = string + default = "GET" +}