Skip to content

Commit 90dcf4d

Browse files
committed
Update GHA to enable manual deploys
This updates the deploy GitHub Action workflow to add the ability to trigger manual one off deploys of specific commits. The workflow now accepts a gitRef input that can be either commit SHA, branch name or a git tag. If a branch name is given, the latest commit on that branch is used. The workflow will build the image for that commit and trigger its deployment to integration. The workflow is still used to build images and trigger continuous deployment for new releases. The workflow has also been renamed from CI to Deploy to better clarify its purpose.
1 parent 2243e47 commit 90dcf4d

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

.github/workflows/ci.yaml renamed to .github/workflows/deploy.yaml

+12-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
name: CI
1+
name: Deploy
22

33
on:
44
workflow_dispatch:
5-
branches:
6-
- main
5+
inputs:
6+
gitRef:
7+
description: 'Commit, tag or branch name to deploy'
8+
required: true
9+
type: string
10+
default: 'main'
711
push:
812
branches:
913
- main
@@ -15,13 +19,18 @@ jobs:
1519
build-and-publish-image:
1620
name: Build and publish image
1721
uses: alphagov/govuk-infrastructure/.github/workflows/ci-ecr.yaml@main
22+
with:
23+
gitRef: ${{ github.event.inputs.gitRef }}
1824
secrets:
1925
AWS_GOVUK_ECR_ACCESS_KEY_ID: ${{ secrets.AWS_GOVUK_ECR_ACCESS_KEY_ID }}
2026
AWS_GOVUK_ECR_SECRET_ACCESS_KEY: ${{ secrets.AWS_GOVUK_ECR_SECRET_ACCESS_KEY }}
2127
trigger-deploy-to-integration:
2228
name: Trigger deploy to integration
2329
needs: build-and-publish-image
2430
uses: alphagov/govuk-infrastructure/.github/workflows/deploy.yaml@main
31+
with:
32+
imageTag: ${{ needs.build-and-publish-image.outputs.imageTag }}
33+
manualDeploy: ${{ 'main' != github.event.inputs.gitRef }}
2534
secrets:
2635
WEBHOOK_TOKEN: ${{ secrets.ARGO_EVENTS_WEBHOOK_TOKEN }}
2736
WEBHOOK_URL: ${{ secrets.ARGO_EVENTS_WEBHOOK_URL }}

0 commit comments

Comments
 (0)