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
2 changes: 2 additions & 0 deletions .github/workflows/cicd-1-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
with:
environments: '["review"]'
commit_sha: ${{ github.event.pull_request.head.sha }}
branch_name: ${{ github.event.pull_request.head.ref }}
secrets: inherit

# Build and publish a pre-release when the 'deploy' label is present.
Expand All @@ -58,4 +59,5 @@ jobs:
environments: '["review"]'
release_tag: pr-${{ github.event.pull_request.number }}
commit_sha: ${{ github.event.pull_request.head.sha }}
branch_name: ${{ github.event.pull_request.head.ref }}
secrets: inherit
6 changes: 6 additions & 0 deletions .github/workflows/cicd-2-main-branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ jobs:
with:
environments: '["dev"]'
commit_sha: ${{ github.sha }}
branch_name: ${{ github.ref_name }}
secrets: inherit

deploy-app-dev:
Expand All @@ -147,6 +148,7 @@ jobs:
environments: '["dev"]'
release_tag: ${{ needs.resolve.outputs.release_tag }}
commit_sha: ${{ github.sha }}
branch_name: ${{ github.ref_name }}
secrets: inherit

# ---- preprod --------------------------------------------------------------
Expand All @@ -164,6 +166,7 @@ jobs:
with:
environments: '["preprod"]'
commit_sha: ${{ github.sha }}
branch_name: ${{ github.ref_name }}
secrets: inherit

deploy-app-preprod:
Expand All @@ -180,6 +183,7 @@ jobs:
environments: '["preprod"]'
release_tag: ${{ needs.resolve.outputs.release_tag }}
commit_sha: ${{ github.sha }}
branch_name: ${{ github.ref_name }}
secrets: inherit

# ---- review (manual only) -------------------------------------------------
Expand All @@ -194,6 +198,7 @@ jobs:
with:
environments: '["review"]'
commit_sha: ${{ github.sha }}
branch_name: ${{ github.ref_name }}
secrets: inherit

deploy-app-review:
Expand All @@ -207,4 +212,5 @@ jobs:
environments: '["review"]'
release_tag: ${{ needs.resolve.outputs.release_tag }}
commit_sha: ${{ github.sha }}
branch_name: ${{ github.ref_name }}
secrets: inherit
3 changes: 3 additions & 0 deletions .github/workflows/cicd-3-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jobs:
environment: dev
release_tag: ${{ github.ref_name }}
commit_sha: ${{ github.sha }}
branch_name: main
secrets: inherit

deploy-preprod:
Expand All @@ -52,6 +53,7 @@ jobs:
environment: preprod
release_tag: ${{ github.ref_name }}
commit_sha: ${{ github.sha }}
branch_name: main
secrets: inherit

prod-approval:
Expand All @@ -71,4 +73,5 @@ jobs:
environment: prod
release_tag: ${{ github.ref_name }}
commit_sha: ${{ github.sha }}
branch_name: main
secrets: inherit
8 changes: 8 additions & 0 deletions .github/workflows/stage-4-deploy-app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ on:
description: Commit SHA used to trigger the ADO pipeline
required: true
type: string
branch_name:
description: Git branch containing commit_sha
required: false
default: "main"
type: string

jobs:
deploy:
Expand Down Expand Up @@ -46,13 +51,16 @@ jobs:
ENVIRONMENT: ${{ matrix.environment }}
RELEASE_TAG: ${{ inputs.release_tag }}
COMMIT_SHA: ${{ inputs.commit_sha }}
BRANCH_NAME: ${{ inputs.branch_name }}
ADO_PROJECT: ${{ github.event.repository.name }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
source "infrastructure/environments/${ENVIRONMENT}/variables.sh"
SOURCE_BRANCH="${BRANCH_NAME:-main}"

echo "Starting Azure DevOps pipeline \"Deploy Gateway App - ${ENVIRONMENT}\"..."
RUN_ID=$(az pipelines run \
--branch "${SOURCE_BRANCH}" \
--commit-id "${COMMIT_SHA}" \
--name "Deploy Gateway App - ${ENVIRONMENT}" \
--org https://dev.azure.com/nhse-dtos \
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/stage-4-deploy-env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ on:
description: Commit SHA used to trigger the ADO pipeline
required: true
type: string
branch_name:
description: Git branch containing commit_sha
required: false
default: "main"
type: string

jobs:
deploy-infra:
Expand All @@ -25,6 +30,7 @@ jobs:
with:
environments: '["${{ inputs.environment }}"]'
commit_sha: ${{ inputs.commit_sha }}
branch_name: ${{ inputs.branch_name }}
secrets: inherit

deploy-app:
Expand All @@ -37,6 +43,7 @@ jobs:
environments: '["${{ inputs.environment }}"]'
release_tag: ${{ inputs.release_tag }}
commit_sha: ${{ inputs.commit_sha }}
branch_name: ${{ inputs.branch_name }}
secrets: inherit

smoke-test:
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/stage-4-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ on:
description: Commit SHA used to trigger the ADO pipeline
required: true
type: string
branch_name:
description: Git branch containing commit_sha
required: false
default: "main"
type: string

jobs:
deploy:
Expand Down Expand Up @@ -41,12 +46,15 @@ jobs:
env:
ENVIRONMENT: ${{ matrix.environment }}
COMMIT_SHA: ${{ inputs.commit_sha }}
BRANCH_NAME: ${{ inputs.branch_name }}
ADO_PROJECT: ${{ github.event.repository.name }}
run: |
source "infrastructure/environments/${ENVIRONMENT}/variables.sh"
SOURCE_BRANCH="${BRANCH_NAME:-main}"

echo "Starting Azure devops pipeline \"Deploy to Azure - ${ENVIRONMENT}\"..."
RUN_ID=$(az pipelines run \
--branch "${SOURCE_BRANCH}" \
--commit-id "${COMMIT_SHA}" \
--name "Deploy to Azure - ${ENVIRONMENT}" \
--org https://dev.azure.com/nhse-dtos \
Expand Down
Loading