Skip to content

Commit

Permalink
Add Release workflow to version deployments
Browse files Browse the repository at this point in the history
This adds a release workflow that creates a new GitHub Release (and git
tag) with an incremental version number. This version tag is then used
to tag images and referenced in the rest of the deployment system. This
makes it easier to compare references (vs commit SHAs). The version tag
is calculated as the last version incremented by the number of merge
commits until the reference commit.
  • Loading branch information
theseanything committed Aug 8, 2023
1 parent e0b9004 commit 0ef4c57
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,16 @@ on:
- staging
- production
default: 'integration'
workflow_run:
workflows: [CI]
types: [completed]
branches: [main]
release:
types: [released]

jobs:
build-and-publish-image:
if: github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success'
if: github.event_name == 'workflow_dispatch' || startsWith(github.ref_name, 'v')
name: Build and publish image
uses: alphagov/govuk-infrastructure/.github/workflows/build-and-push-image.yml@main
with:
gitRef: ${{ inputs.gitRef || github.ref }}
gitRef: ${{ inputs.gitRef || github.ref_name }}
secrets:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_GOVUK_ECR_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_GOVUK_ECR_SECRET_ACCESS_KEY }}
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Release

on:
workflow_dispatch:
workflow_run:
workflows: [CI]
types: [completed]
branches: [main]

jobs:
release:
if: github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success'
name: Release
uses: alphagov/govuk-infrastructure/.github/workflows/release.yml@main
secrets:
GH_TOKEN: ${{ secrets.GOVUK_CI_GITHUB_API_TOKEN }}

0 comments on commit 0ef4c57

Please sign in to comment.