Skip to content
This repository has been archived by the owner on Jan 17, 2025. It is now read-only.

Commit

Permalink
Merge pull request #153 from communitiesuk/FS-3718
Browse files Browse the repository at this point in the history
FS-3718 Update tag version generation to be unified
  • Loading branch information
aaronwilliamsv1 authored Nov 8, 2023
2 parents da45f5d + 4910de2 commit a14d09e
Showing 1 changed file with 26 additions and 10 deletions.
36 changes: 26 additions & 10 deletions .github/workflows/copilot_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ 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
pre_deploy_tests:
secrets:
E2E_PAT: ${{ secrets.E2E_PAT }}
Expand All @@ -44,12 +53,13 @@ jobs:
postgres_unit_testing: false

paketo_build:
needs: [ tag_version ]
concurrency: build-notification-pack
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-notification

Expand All @@ -60,24 +70,29 @@ jobs:
steps:
- id: copilot_env_matrix
run: |
if [ "${{ inputs.environment }}" != '' ]; then
if [ "${{ inputs.environment }}" != "" ]; then
echo "env_list=[\"${{ inputs.environment }}\"]" >> $GITHUB_OUTPUT
elif [ "${{ github.ref }}" == 'refs/heads/main' ]; then
echo "env_list=[\"dev\", \"test\", \"uat\", \"production\"]" >> $GITHUB_OUTPUT
else
echo "env_list=[\"dev\", \"test\"]" >> $GITHUB_OUTPUT
fi
copilot_environments_deploy:
concurrency: notification-environment-deploy
copilot_env_deploy:
concurrency:
group: '${{ github.workflow }} @ ${{ github.ref }}'
cancel-in-progress: false
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
continue-on-error: true
strategy:
max-parallel: 1
matrix:
value: ${{ fromJSON(needs.copilot_environments_workflow_setup.outputs.matrix) }}
fail-fast: false
environment: ${{ matrix.value }}
steps:
- name: Git clone the repository
Expand Down Expand Up @@ -106,20 +121,21 @@ jobs:
- name: Inject replacement image into manifest
run: |
yq -i '.image.location = "ghcr.io/communitiesuk/funding-service-design-notification:${{ github.ref_name == 'main' && 'latest' || github.ref_name }}"' copilot/fsd-notification/manifest.yml
yq -i '.image.location = "ghcr.io/communitiesuk/funding-service-design-notification:${{ github.ref_name == 'main' && 'latest' || needs.tag_version.outputs.version_to_tag }}"' copilot/fsd-notification/manifest.yml
- name: Copilot ${{ matrix.value }} deploy
id: deploy_build
run: |
copilot svc deploy --env ${{ matrix.value }} --app pre-award
post_deploy_tests:
if: inputs.environment == 'test' || inputs.environment == ''
needs: copilot_environments_deploy
if: inputs.environment == 'test' || inputs.environment == 'dev' || inputs.environment == ''
needs: copilot_env_deploy
secrets:
E2E_PAT: ${{secrets.E2E_PAT}}
uses: communitiesuk/funding-service-design-workflows/.github/workflows/post-deploy.yml@main
with:
run_performance_tests: ${{ inputs.run_performance_tests }}
run_e2e_tests: ${{ inputs.run_e2e_tests }}
run_performance_tests: ${{ inputs.run_performance_tests || false }}
run_e2e_tests: ${{ inputs.run_e2e_tests || true }}
app_name: notification
environment: ${{ inputs.environment == '' && 'test' || inputs.environment }}

0 comments on commit a14d09e

Please sign in to comment.