From 452aa2d38f4e750580fc77c8a979019916c53af0 Mon Sep 17 00:00:00 2001 From: nimalank7 Date: Thu, 13 Jun 2024 16:19:29 +0100 Subject: [PATCH] Use new release workflow Description: - New 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. - Adds a .gitignore file - Based off https://github.com/alphagov/frontend/pull/3722 - Closes https://github.com/alphagov/govuk-dependency-checker/issues/41 --- .github/workflows/deploy.yml | 5 ++++- .github/workflows/release.yml | 16 ++++++++++++++++ .gitignore | 2 ++ 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release.yml create mode 100644 .gitignore diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index f01a2b0..cd4e273 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -10,13 +10,16 @@ on: required: true type: string default: 'main' + release: + types: [released] jobs: build-and-publish-image: + 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 }} permissions: id-token: write contents: read diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..8793223 --- /dev/null +++ b/.github/workflows/release.yml @@ -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 }} \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3502c0e --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# Ignore bundler config +/.bundle \ No newline at end of file