Skip to content

Commit b21d175

Browse files
committed
Simple github actions added for release and deploy
1 parent 13cb226 commit b21d175

2 files changed

Lines changed: 64 additions & 0 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Deploy
2+
3+
run-name: Deploy ${{ inputs.gitRef || github.event.release.tag_name }} to ${{ inputs.environment || 'integration' }}
4+
5+
on:
6+
workflow_dispatch:
7+
inputs:
8+
gitRef:
9+
description: 'Commit, tag or branch name to deploy'
10+
required: true
11+
type: string
12+
environment:
13+
description: 'Environment to deploy to'
14+
required: true
15+
type: choice
16+
options:
17+
- integration
18+
default: 'integration'
19+
release:
20+
types: [released]
21+
22+
jobs:
23+
build-and-publish-image:
24+
if: github.event_name == 'workflow_dispatch' || startsWith(github.event.release.tag_name, 'v')
25+
name: Build and publish image
26+
permissions:
27+
id-token: write
28+
contents: read
29+
packages: write
30+
uses: alphagov/govuk-infrastructure/.github/workflows/build-and-push-multiarch-image.yml@main
31+
with:
32+
gitRef: ${{ inputs.gitRef || github.event.release.tag_name }}
33+
secrets:
34+
BUILD_SECRETS: |
35+
"GITHUB_TOKEN=${{ secrets.GOVUK_CI_GITHUB_API_TOKEN }}"
36+
37+
trigger-deploy:
38+
name: Trigger deploy to ${{ inputs.environment || 'integration' }}
39+
needs: build-and-publish-image
40+
uses: alphagov/govuk-infrastructure/.github/workflows/deploy.yml@main
41+
with:
42+
imageTag: ${{ needs.build-and-publish-image.outputs.imageTag }}
43+
environment: ${{ inputs.environment || 'integration' }}
44+
secrets:
45+
WEBHOOK_TOKEN: ${{ secrets.GOVUK_ARGO_EVENTS_WEBHOOK_TOKEN }}
46+
WEBHOOK_URL: ${{ secrets.GOVUK_ARGO_EVENTS_WEBHOOK_URL }}
47+
GH_TOKEN: ${{ secrets.GOVUK_CI_GITHUB_API_TOKEN }}
48+

.github/workflows/release.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
workflow_run:
6+
workflows: [CI]
7+
types: [completed]
8+
branches: [main]
9+
10+
jobs:
11+
release:
12+
if: github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success'
13+
name: Release
14+
uses: alphagov/govuk-infrastructure/.github/workflows/release.yml@main
15+
secrets:
16+
GH_TOKEN: ${{ secrets.GOVUK_CI_GITHUB_API_TOKEN }}

0 commit comments

Comments
 (0)