Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/aws_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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 }}
Expand Down
39 changes: 9 additions & 30 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 }}
Expand Down Expand Up @@ -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'
Expand All @@ -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 }}
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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 }}
run: echo "current version does not match deployed version"; exit 1
4 changes: 2 additions & 2 deletions .github/workflows/delete_stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment on lines 32 to +35
with:
role-to-assume: arn:aws:iam::${{inputs.account-id }}:role/${{ env.AWS_GITHUB_ROLE }}
aws-region: ${{ inputs.region}}
Expand All @@ -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
Comment on lines 50 to +53
with:
role-to-assume: arn:aws:iam::${{inputs.account-id }}:role/${{ env.AWS_GITHUB_ROLE }}
aws-region: ${{ inputs.region}}
Expand Down
18 changes: 1 addition & 17 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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 }}
4 changes: 2 additions & 2 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down