Skip to content

Deploy main to integration #111

Deploy main to integration

Deploy main to integration #111

Workflow file for this run

name: Deploy
run-name: Deploy ${{ inputs.gitRef || github.ref_name }} to ${{ inputs.environment || 'integration' }}
on:
workflow_dispatch:
inputs:
gitRef:
description: 'Commit, tag or branch name to deploy'
required: true
type: string
default: 'main'
environment:
description: 'Environment to deploy to'
required: true
type: choice
options:
- integration
- staging
- production
default: 'integration'
workflow_run:
workflows: [CI]
types: [completed]
branches: [main]
jobs:
build-and-publish-image:
if: github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success'
name: Build and publish image
uses: alphagov/govuk-infrastructure/.github/workflows/build-and-push-image.yml@main
with:
gitRef: ${{ inputs.gitRef || github.ref }}
secrets:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_GOVUK_ECR_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_GOVUK_ECR_SECRET_ACCESS_KEY }}
trigger-deploy:
name: Trigger deploy to ${{ inputs.environment || 'integration' }}
needs: build-and-publish-image
uses: alphagov/govuk-infrastructure/.github/workflows/deploy.yml@main
with:
imageTag: ${{ needs.build-and-publish-image.outputs.imageTag }}
environment: ${{ inputs.environment || 'integration' }}
secrets:
WEBHOOK_TOKEN: ${{ secrets.GOVUK_ARGO_EVENTS_WEBHOOK_TOKEN }}
WEBHOOK_URL: ${{ secrets.GOVUK_ARGO_EVENTS_WEBHOOK_URL }}
GH_TOKEN: ${{ secrets.GOVUK_CI_GITHUB_API_TOKEN }}