Skip to content
This repository was archived by the owner on Mar 19, 2025. It is now read-only.

Commit f44a772

Browse files
authored
Merge pull request #6 from alphagov/update-deployment
Update deployment
2 parents 727d7dc + 5499632 commit f44a772

File tree

3 files changed

+40
-5
lines changed

3 files changed

+40
-5
lines changed

.github/workflows/deploy.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Deploy
22

3-
run-name: Deploy ${{ inputs.gitRef || github.ref_name }} to integration
3+
run-name: Deploy ${{ inputs.gitRef || github.event.release.tag_name }} to ${{ inputs.environment || 'production' }}
44

55
on:
66
workflow_dispatch:
@@ -9,26 +9,33 @@ on:
99
description: 'Commit, tag or branch name to deploy'
1010
required: true
1111
type: string
12+
environment:
13+
description: 'Environment to deploy to'
14+
required: true
15+
type: choice
16+
options:
17+
- production
18+
default: 'production'
1219
release:
1320
types: [released]
1421

1522
jobs:
1623
build-and-publish-image:
17-
if: github.event_name == 'workflow_dispatch' || startsWith(github.ref_name, 'v')
24+
if: github.event_name == 'workflow_dispatch' || startsWith(github.event.release.tag_name, 'v')
1825
name: Build and publish image
1926
uses: alphagov/govuk-infrastructure/.github/workflows/build-and-push-image.yml@main
2027
with:
21-
gitRef: ${{ inputs.gitRef || github.ref_name }}
28+
gitRef: ${{ inputs.gitRef || github.event.release.tag_name }}
2229
secrets:
2330
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_GOVUK_ECR_ACCESS_KEY_ID }}
2431
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_GOVUK_ECR_SECRET_ACCESS_KEY }}
2532
trigger-deploy:
26-
name: Trigger deploy to integration
33+
name: Trigger deploy to ${{ inputs.environment || 'production' }}
2734
needs: build-and-publish-image
2835
uses: alphagov/govuk-infrastructure/.github/workflows/deploy.yml@main
2936
with:
3037
imageTag: ${{ needs.build-and-publish-image.outputs.imageTag }}
31-
environment: integration
38+
environment: ${{ inputs.environment || 'production' }}
3239
secrets:
3340
WEBHOOK_TOKEN: ${{ secrets.GOVUK_ARGO_EVENTS_WEBHOOK_TOKEN }}
3441
WEBHOOK_URL: ${{ secrets.GOVUK_ARGO_EVENTS_WEBHOOK_URL }}

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ In production, it's run from a scheduled task via its `./collect` executable.
2828

2929
`bundle exec rspec`
3030

31+
### Docs
32+
33+
[Deployments](docs/deployments.md)
34+
3135
## Licence
3236

3337
[MIT License](LICENCE.txt)

docs/deployments.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Deployments
2+
3+
## Target environment
4+
5+
This project only runs in production and only has the one target environment for deployments.
6+
7+
For this reason, deployment promotion between environments has no meaning for this project.
8+
9+
## How deployment works
10+
11+
Since the project is run from a scheduled task (a K8s `CronJob`), its deployment process differs slightly from that of our apps and some details might prove useful to be aware of if they're not already familiar to you.
12+
13+
Everytime it's run on its schedule, a new Pod will pull a new copy of this project's Docker image from ECR. This differs from the way apps work in that an app's long-running Pods are reprovisioned with the new image once, during the deployment itself.
14+
15+
As with our other projects, when changes are merged, a new release tag is created and in turn, the changes will be deployed automatically.
16+
17+
## Deploying to integration
18+
19+
Because the scheduled task only usually runs in production, some changes are required to enable a version to be deployed to integration (e.g. for testing),
20+
21+
* "integration" will have to be added to the list of target environments in [this repository's deploy workflow](https://github.com/alphagov/govuk-sli-collector/blob/main/.github/workflows/deploy.yml)
22+
* [the production Helm charts configuration](https://github.com/alphagov/govuk-helm-charts/blob/1adc5596a3fa5df5b030c8248c338ec0293a4ea7/charts/app-config/values-production.yaml#L1275) will have to be copied into [the equivalent integration file](https://github.com/alphagov/govuk-helm-charts/blob/1adc5596a3fa5df5b030c8248c338ec0293a4ea7/charts/app-config/values-integration.yaml)
23+
24+
(If you only need integration temporarily, don't forget to revert these changes when you're done.)

0 commit comments

Comments
 (0)