Skip to content

Commit

Permalink
Update GHA to enable manual deploys
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
theseanything committed Apr 29, 2022
1 parent 2243e47 commit 90dcf4d
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/ci.yaml → .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
name: CI
name: Deploy

on:
workflow_dispatch:
branches:
- main
inputs:
gitRef:
description: 'Commit, tag or branch name to deploy'
required: true
type: string
default: 'main'
push:
branches:
- main
Expand All @@ -15,13 +19,18 @@ jobs:
build-and-publish-image:
name: Build and publish image
uses: alphagov/govuk-infrastructure/.github/workflows/ci-ecr.yaml@main
with:
gitRef: ${{ github.event.inputs.gitRef }}
secrets:
AWS_GOVUK_ECR_ACCESS_KEY_ID: ${{ secrets.AWS_GOVUK_ECR_ACCESS_KEY_ID }}
AWS_GOVUK_ECR_SECRET_ACCESS_KEY: ${{ secrets.AWS_GOVUK_ECR_SECRET_ACCESS_KEY }}
trigger-deploy-to-integration:
name: Trigger deploy to integration
needs: build-and-publish-image
uses: alphagov/govuk-infrastructure/.github/workflows/deploy.yaml@main
with:
imageTag: ${{ needs.build-and-publish-image.outputs.imageTag }}
manualDeploy: ${{ 'main' != github.event.inputs.gitRef }}
secrets:
WEBHOOK_TOKEN: ${{ secrets.ARGO_EVENTS_WEBHOOK_TOKEN }}
WEBHOOK_URL: ${{ secrets.ARGO_EVENTS_WEBHOOK_URL }}

0 comments on commit 90dcf4d

Please sign in to comment.