From dcd4b3ad649efc14b6a2bfa4c57465c8b03777ed Mon Sep 17 00:00:00 2001 From: Robert Kibble Date: Tue, 7 Nov 2023 16:31:25 +0000 Subject: [PATCH] BAU - use a single source for version --- .github/workflows/copilot_deploy.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/copilot_deploy.yml b/.github/workflows/copilot_deploy.yml index 141af55b..205f5229 100644 --- a/.github/workflows/copilot_deploy.yml +++ b/.github/workflows/copilot_deploy.yml @@ -35,12 +35,22 @@ on: - '.github/workflows/copilot_deploy.yml' jobs: + tag_version: + runs-on: ubuntu-latest + outputs: + version_to_tag: ${{ steps.notification_tagging.outputs.tag_value }} + steps: + - id: notification_tagging + run: | + echo "tag_value=$(echo '${{ github.ref }}' | sed -e 's,.*/\(.*\),\1,')" >> $GITHUB_OUTPUT + paketo_build: + needs: [ tag_version ] permissions: packages: write uses: communitiesuk/funding-service-design-workflows/.github/workflows/package.yml@main with: - version_to_build: $(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') + version_to_build: ${{ needs.tag_version.outputs.version_to_tag }} owner: ${{ github.repository_owner }} application: funding-service-design-fund-store pre_deploy_tests: @@ -71,7 +81,7 @@ jobs: permissions: id-token: write # This is required for requesting the JWT contents: read # This is required for actions/checkout - needs: [ pre_deploy_tests, paketo_build, copilot_environments_workflow_setup ] + needs: [ tag_version, pre_deploy_tests, paketo_build, copilot_environments_workflow_setup ] runs-on: ubuntu-latest strategy: matrix: @@ -104,7 +114,7 @@ jobs: - name: Inject replacement image into manifest run: | - yq -i '.image.location = "ghcr.io/communitiesuk/funding-service-design-fund-store:${{ github.ref_name == 'main' && 'latest' || github.ref_name }}"' copilot/fsd-fund-store/manifest.yml + yq -i '.image.location = "ghcr.io/communitiesuk/funding-service-design-fund-store:${{ github.ref_name == 'main' && 'latest' || needs.tag_version.outputs.version_to_tag }}"' copilot/fsd-fund-store/manifest.yml - name: Copilot ${{ matrix.value }} deploy id: deploy_build