forked from alphagov/whitehall
-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (43 loc) · 1.53 KB
/
deploy.yaml
File metadata and controls
45 lines (43 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Deploy
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:
name: Build and publish image
if: github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success'
uses: alphagov/govuk-infrastructure/.github/workflows/ci-ecr.yaml@main
with:
gitRef: ${{ github.event.inputs.gitRef || github.ref }}
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:
name: Trigger deploy to ${{ github.event.inputs.environment }}
needs: build-and-publish-image
uses: alphagov/govuk-infrastructure/.github/workflows/deploy.yaml@main
with:
imageTag: ${{ needs.build-and-publish-image.outputs.imageTag }}
environment: ${{ github.event.inputs.environment }}
secrets:
WEBHOOK_TOKEN: ${{ secrets.GOVUK_INTEGRATION_ARGO_EVENTS_WEBHOOK_TOKEN }}
WEBHOOK_URL: ${{ secrets.GOVUK_INTEGRATION_ARGO_EVENTS_WEBHOOK_URL }}
GOVUK_CI_GITHUB_API_TOKEN: ${{ secrets.GOVUK_CI_GITHUB_API_TOKEN }}