Skip to content

Commit

Permalink
Merge pull request #726 from DFE-Digital/deployment-workflow
Browse files Browse the repository at this point in the history
v5.0.0 of Container App release workflow
  • Loading branch information
DrizzlyOwl authored Feb 17, 2025
2 parents 426f2ef + e394be6 commit 63d4749
Showing 1 changed file with 47 additions and 50 deletions.
97 changes: 47 additions & 50 deletions .github/workflows/deploy-to-environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ env:
jobs:
set-env:
name: Determine environment
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
outputs:
environment: ${{ steps.var.outputs.environment }}
branch: ${{ steps.var.outputs.branch }}
Expand Down Expand Up @@ -69,7 +69,7 @@ jobs:
if: needs.set-env.outputs.environment == 'production'
name: Tag and release
needs: [ set-env, validate-packages ]
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -97,36 +97,14 @@ jobs:
core.setFailed(error.message);
}
build:
name: Build
build-import:
name: Build & Import
needs: [ set-env, validate-packages ]
runs-on: ubuntu-24.04
environment: ${{ needs.set-env.outputs.environment }}
permissions:
packages: write
uses: DFE-Digital/deploy-azure-container-apps-action/.github/workflows/[email protected]
strategy:
matrix:
stage: [
"final",
"initcontainer"
]
include:
- stage: "final"
tag-prefix: ""
- stage: "initcontainer"
tag-prefix: "init-"
with:
environment: ${{ needs.set-env.outputs.environment }}
docker-image-name: ${{ needs.set-env.outputs.image-name }}
docker-build-file-name: 'docker/Dockerfile'
docker-build-target: ${{ matrix.stage }}
docker-tag-prefix: ${{ matrix.tag-prefix }}

import:
name: Import
needs: [ set-env, build ]
permissions:
id-token: write
uses: DFE-Digital/deploy-azure-container-apps-action/.github/workflows/[email protected]
strategy:
matrix:
stage: [
Expand All @@ -138,33 +116,52 @@ jobs:
tag-prefix: ""
- stage: "initcontainer"
tag-prefix: "init-"
with:
environment: ${{ needs.set-env.outputs.environment }}
docker-image-name: ${{ needs.set-env.outputs.image-name }}
docker-tag-prefix: ${{ matrix.tag-prefix }}
secrets:
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
azure-subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
azure-acr-client-id: ${{ secrets.ACR_CLIENT_ID }}
azure-acr-name: ${{ secrets.ACR_NAME }}
steps:
- uses: DFE-Digital/deploy-azure-container-apps-action/.github/actions/[email protected]
with:
build-file-name: 'docker/Dockerfile'
build-args: CI=true
build-target: ${{ matrix.stage }}
image-name: ${{ needs.set-env.outputs.image-name }}
tag-prefix: ${{ matrix.tag-prefix }}
github-token: ${{ secrets.GITHUB_TOKEN }}

- uses: DFE-Digital/deploy-azure-container-apps-action/.github/actions/[email protected]
with:
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
azure-subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
azure-acr-client-id: ${{ secrets.ACR_CLIENT_ID }}
azure-acr-name: ${{ secrets.ACR_NAME }}
image-name: ${{ needs.set-env.outputs.image-name }}
tag-prefix: ${{ matrix.tag-prefix }}
github-token: ${{ secrets.GITHUB_TOKEN }}
env:
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID || '' }}
AZURE_SUBSCRIPTION: ${{ secrets.AZURE_SUBSCRIPTION_ID || '' }}
AZURE_ACR_CLIENT_ID: ${{ secrets.ACR_CLIENT_ID || '' }}

deploy:
name: Deploy
needs: [ set-env, import ]
needs: [ set-env, build-import ]
runs-on: ubuntu-24.04
environment: ${{ needs.set-env.outputs.environment }}
permissions:
id-token: write
uses: DFE-Digital/deploy-azure-container-apps-action/.github/workflows/[email protected]
with:
environment: ${{ needs.set-env.outputs.environment }}
docker-image-name: ${{ needs.set-env.outputs.image-name }}
annotate-release: true
secrets:
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
azure-subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
azure-acr-name: ${{ secrets.ACR_NAME }}
azure-aca-client-id: ${{ secrets.ACA_CLIENT_ID }}
azure-aca-name: ${{ secrets.ACA_CONTAINERAPP_NAME }}
azure-aca-resource-group: ${{ secrets.ACA_RESOURCE_GROUP }}
steps:
- uses: DFE-Digital/deploy-azure-container-apps-action/.github/actions/[email protected]
with:
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
azure-subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
azure-aca-client-id: ${{ secrets.ACA_CLIENT_ID }}
azure-aca-name: ${{ secrets.ACA_CONTAINERAPP_NAME }}
azure-aca-resource-group: ${{ secrets.ACA_RESOURCE_GROUP }}
azure-acr-name: ${{ secrets.ACR_NAME }}
annotate-release: true
image-name: ${{ needs.set-env.outputs.image-name }}
env:
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID || '' }}
AZURE_SUBSCRIPTION: ${{ secrets.AZURE_SUBSCRIPTION_ID || '' }}
AZURE_ACA_CLIENT_ID: ${{ secrets.ACA_CLIENT_ID || '' }}

run-automated-ui-tests:
name: Run automated UI tests
Expand Down

0 comments on commit 63d4749

Please sign in to comment.