diff --git a/.github/workflows/aws_ci.yml b/.github/workflows/aws_ci.yml index d341528..4941d4d 100644 --- a/.github/workflows/aws_ci.yml +++ b/.github/workflows/aws_ci.yml @@ -17,8 +17,8 @@ jobs: id-token: write contents: read steps: - - uses: actions/checkout@v4 - - uses: aws-actions/configure-aws-credentials@v4 + - uses: actions/checkout@v6 + - uses: aws-actions/configure-aws-credentials@v6 with: role-to-assume: arn:aws:iam::${{ env.AWS_ACCOUNT_ID }}:role/cad-github-actions-role aws-region: ${{ env.AWS_REGION }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ebe0b9b..0510669 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,7 +17,7 @@ jobs: outputs: json: ${{ steps.parse.outputs.json }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - id: parse run: | PARAMS=$(jq 'map(split("=")| { (.[0]|tostring): .[1]} ) | add' < ./aws/${{ (startsWith(github.ref_name, 'dr-')) && 'dr' || github.ref_name }}.json) @@ -32,7 +32,6 @@ jobs: aws_account_id: ${{ fromJSON(needs.aws-params.outputs.json).awsAccountId }} aws_parameters: ${{ (startsWith(github.ref_name, 'dr-')) && 'dr' || github.ref_name }} aws_region: ${{ fromJSON(needs.aws-params.outputs.json).awsRegion }} - do_deploy: ${{ (fromJSON(needs.aws-params.outputs.json).envType == 'prod') && true || github.ref_name == github.event.repository.default_branch }} env_type: ${{ fromJSON(needs.aws-params.outputs.json).envType }} github_env: ${{ fromJSON(needs.aws-params.outputs.json).envType }} dr_test: ${{ fromJSON(needs.aws-params.outputs.json).drTest }} diff --git a/.github/workflows/build_and_deploy.yml b/.github/workflows/build_and_deploy.yml index a577c41..4232c66 100644 --- a/.github/workflows/build_and_deploy.yml +++ b/.github/workflows/build_and_deploy.yml @@ -18,9 +18,6 @@ on: aws_region: description: 'The AWS region' type: string - do_deploy: - description: 'Flag for whether to deploy or not' - type: boolean env_type: description: 'The environment type, e.g. test, beta, prod' type: string @@ -48,8 +45,8 @@ jobs: ecr_repo_uri: ${{ steps.query.outputs.ecr_repo_uri }} solution_stack: ${{ steps.query-eb.outputs.solution_stack }} steps: - - uses: actions/checkout@v4 - - uses: aws-actions/configure-aws-credentials@v4 + - uses: actions/checkout@v6 + - uses: aws-actions/configure-aws-credentials@v6 with: role-to-assume: arn:aws:iam::${{ inputs.aws_account_id }}:role/cad-github-actions-role aws-region: ${{ inputs.aws_region }} @@ -90,10 +87,10 @@ jobs: TAG_REF: ${{ inputs.ref }} DOCKER_REPO: ${{ needs.bootstrap.outputs.ecr_repo_uri }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: ref: ${{ env.COMMIT_SHA }} - - uses: actions/setup-java@v4 + - uses: actions/setup-java@v5 with: java-version-file: '.java-version' distribution: 'temurin' @@ -103,7 +100,7 @@ jobs: - name: Set docker tag run: echo "DOCKER_TAG=github.${GITHUB_REF##*/}.${GITHUB_RUN_NUMBER}" | sed 's/#/-/g' | tee -a $GITHUB_ENV - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 + uses: aws-actions/configure-aws-credentials@v6 with: role-to-assume: arn:aws:iam::${{ inputs.aws_account_id }}:role/cad-github-actions-role aws-region: ${{ inputs.aws_region }} @@ -125,7 +122,7 @@ jobs: - name: Generate deployment package run: cd elasticbeanstalk; zip -r ../aws/build/docker.zip . -x '*.git*' - name: Upload AWS artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: aws-backend path: aws @@ -141,27 +138,17 @@ jobs: permissions: id-token: write contents: read - deployments: write env: # We use toJSON here so that we escape quotes in the JSON string (hopefully) APP_VERSION: ${{ toJSON(format('appVersionDesc={0}', needs.build.outputs.message)) }} SOLUTION_STACK: ${{ toJSON(format('solutionStack={0}', needs.bootstrap.outputs.solution_stack)) }} steps: - name: Download AWS artifact - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: aws-backend - - name: Start deployment - uses: bobheadxi/deployments@v1.5.0 - if: inputs.do_deploy - id: deployment - with: - step: start - env: backend-${{ inputs.github_env }} - desc: ${{ inputs.github_env }} deploy of ${{ inputs.ref }} - ref: ${{ inputs.ref }} - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 + uses: aws-actions/configure-aws-credentials@v6 id: aws-credentials with: role-to-assume: arn:aws:iam::${{ inputs.aws_account_id }}:role/cad-github-actions-role @@ -203,12 +190,4 @@ jobs: - run: echo VERSION_REF=$(aws cloudformation list-exports --query "Exports[?Name=='${{ inputs.app_name }}-${{ inputs.env_type }}-${{ inputs.account_type }}-backend-version'].Value" --output text) | tee -a $GITHUB_ENV - run: echo RUNNING_VERSION_REF=$(aws elasticbeanstalk describe-environments | jq -r '.Environments | map(select(.EnvironmentName == "${{ inputs.app_name }}-${{ inputs.env_type }}")) | .[] | .VersionLabel') | tee -a $GITHUB_ENV - if: env.VERSION_REF != env.RUNNING_VERSION_REF - run: echo "current version does not match deployed version"; exit 1 - - name: Update deployment status - uses: bobheadxi/deployments@v1.5.0 - if: always() && inputs.do_deploy - with: - step: finish - env: backend-${{ inputs.github_env }} - status: ${{ job.status }} - deployment_id: ${{ steps.deployment.outputs.deployment_id }} \ No newline at end of file + run: echo "current version does not match deployed version"; exit 1 \ No newline at end of file diff --git a/.github/workflows/delete_stack.yml b/.github/workflows/delete_stack.yml index 79e4bbd..dda19be 100644 --- a/.github/workflows/delete_stack.yml +++ b/.github/workflows/delete_stack.yml @@ -32,7 +32,7 @@ jobs: env: AWS_STACK_PREFIX: ${{needs.aws-params.outputs.stack-prefix}} steps: - - uses: aws-actions/configure-aws-credentials@v4 + - uses: aws-actions/configure-aws-credentials@v6 with: role-to-assume: arn:aws:iam::${{inputs.account-id }}:role/${{ env.AWS_GITHUB_ROLE }} aws-region: ${{ inputs.region}} @@ -50,7 +50,7 @@ jobs: env: AWS_STACK_PREFIX: ${{needs.aws-params.outputs.stack-prefix}} steps: - - uses: aws-actions/configure-aws-credentials@v4 + - uses: aws-actions/configure-aws-credentials@v6 with: role-to-assume: arn:aws:iam::${{inputs.account-id }}:role/${{ env.AWS_GITHUB_ROLE }} aws-region: ${{ inputs.region}} diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 606260a..02db283 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -33,16 +33,8 @@ jobs: AWS_SECRET_ACCESS_KEY: ${{ secrets.PROD_AWS_SECRET_ACCESS_KEY }} TAG: ${{ inputs.tag }} steps: - - name: Start deployment - uses: bobheadxi/deployments@v1.4.0 - id: deployment - with: - step: start - env: prod - desc: Production deploy of ${{ env.TAG }} - ref: refs/tags/${{ env.TAG }} - name: Deploy to EB - uses: einaregilsson/beanstalk-deploy@v21 + uses: einaregilsson/beanstalk-deploy@v22 timeout-minutes: 15 with: aws_access_key: ${{ secrets.PROD_AWS_ACCESS_KEY_ID }} @@ -53,11 +45,3 @@ jobs: region: ${{ env.AWS_REGION }} - name: Save version in secrets manager run: aws secretsmanager update-secret --secret-id ${{ vars.VERSION_SECRET }} --secret-string github.${{ env.TAG }} - - name: Update deployment status - uses: bobheadxi/deployments@v1.4.0 - if: always() - with: - step: finish - env: ${{ steps.deployment.outputs.env }} - status: ${{ job.status }} - deployment_id: ${{ steps.deployment.outputs.deployment_id }} diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 3f863b7..d1d22fc 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -12,8 +12,8 @@ jobs: runs-on: ubuntu-22.04 timeout-minutes: 10 steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 + - uses: actions/checkout@v6 + - uses: actions/setup-java@v5 with: java-version-file: .java-version distribution: temurin