Merge pull request #1648 from guardian/param-rename #1124
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Notification worker lambdas | |
| on: | |
| push: | |
| paths: | |
| - notificationworkerlambda/** | |
| - common/** | |
| - commoneventconsumer/** | |
| - cdk/** | |
| - project/** | |
| - build.sbt | |
| - .github/workflows/notification-worker-lambdas.yml | |
| workflow_dispatch: | |
| # allow queued workflows to interrupt previous runs | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.number || github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| id-token: write | |
| contents: read | |
| checks: write | |
| pull-requests: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6.0.2 | |
| - name: Setup JDK and sbt | |
| uses: guardian/setup-scala@v1 | |
| - run: corepack enable | |
| - uses: actions/setup-node@v6 | |
| with: | |
| cache: yarn | |
| cache-dependency-path: cdk/yarn.lock | |
| node-version-file: .nvmrc | |
| - uses: aws-actions/configure-aws-credentials@v5 | |
| with: | |
| aws-region: eu-west-1 | |
| role-to-assume: ${{ secrets.AWS_ROLE_ARN }} | |
| mask-aws-account-id: true | |
| - name: Login to ECR | |
| uses: aws-actions/amazon-ecr-login@v1 | |
| with: | |
| mask-password: 'true' | |
| - name: Compile and test | |
| run: sbt "project common" "compile" "test" "project notificationworkerlambda" "compile" "test" | |
| - name: Test Report | |
| uses: dorny/test-reporter@v2 | |
| if: success() || failure() # run this step even if previous step failed | |
| with: | |
| name: Tests | |
| path: notificationworkerlambda/target/test-reports/TEST-*.xml | |
| reporter: java-junit | |
| only-summary: 'false' | |
| fail-on-error: 'true' | |
| - name: Build docker image | |
| run: sbt docker:publishLocal | |
| - name: Publish docker image | |
| run: | | |
| BUILD_NUMBER_WITH_OFFSET=$(($BUILD_NUMBER+4147)) | |
| docker tag notificationworkerlambda:DEV $NOTIFICATION_LAMBDA_REPOSITORY_URL:$BUILD_NUMBER_WITH_OFFSET | |
| docker push ${NOTIFICATION_LAMBDA_REPOSITORY_URL}:${BUILD_NUMBER_WITH_OFFSET} | |
| env: | |
| NOTIFICATION_LAMBDA_REPOSITORY_ID: ${{ secrets.NOTIFICATION_LAMBDA_REPOSITORY_ID }} | |
| NOTIFICATION_LAMBDA_REPOSITORY_URL: ${{ secrets.NOTIFICATION_LAMBDA_REPOSITORY_URL }} | |
| BUILD_NUMBER: ${{ github.run_number }} | |
| - name: CDK synth | |
| working-directory: cdk | |
| run: | | |
| yarn install --immutable | |
| yarn lint | |
| yarn test | |
| yarn synth | |
| - name: Upload to riff-raff | |
| uses: guardian/actions-riff-raff@v4 | |
| with: | |
| roleArn: ${{ secrets.GU_RIFF_RAFF_ROLE_ARN }} | |
| githubToken: ${{ secrets.GITHUB_TOKEN }} | |
| projectName: mobile-n10n:notificationworkerlambda | |
| buildNumberOffset: 4147 | |
| configPath: notificationworkerlambda/riff-raff.yaml | |
| contentDirectories: | | |
| mobile-notifications-harvester-cfn: | |
| - notificationworkerlambda/harvester-cfn.yaml | |
| mobile-notifications-workers-cfn: | |
| - cdk/cdk.out/SenderWorkerStack-CODE.template.json | |
| - cdk/cdk.out/SenderWorkerStack-PROD.template.json | |
| mobile-notifications-topic-counter-cfn: | |
| - notificationworkerlambda/topic-counter-cfn.yaml | |
| mobile-notifications-registration-cleaning-worker-cfn: | |
| - notificationworkerlambda/registration-cleaning-worker-cfn.yaml | |
| mobile-notifications-expired-registration-cleaner-cfn: | |
| - notificationworkerlambda/expired-registration-cleaner-cfn.yaml | |
| registrations-db-proxy-cfn: | |
| - cdk/cdk.out/RegistrationsDbProxy-CODE.template.json | |
| - cdk/cdk.out/RegistrationsDbProxy-PROD.template.json |