Skip to content

Guardian Ad-Lite: Thankyou #9971

Guardian Ad-Lite: Thankyou

Guardian Ad-Lite: Thankyou #9971

name: Build support-workers
on:
pull_request:
workflow_dispatch:
push:
branches:
- main
env:
GU_SUPPORT_WORKERS_LOAD_S3_CONFIG: false
jobs:
support_workers_build:
if: >-
(github.actor != 'dependabot[bot]') &&
(github.repository_owner == 'guardian' ||
github.event_name == 'push')
permissions:
id-token: write
contents: read
pull-requests: write
name: support-workers build
runs-on: ubuntu-latest
steps:
- name: Env
run: env
- name: Checkout repo
uses: actions/checkout@v4
# (Respects .nvmrc)
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: "yarn"
cache-dependency-path: cdk/yarn.lock
- name: Build CFN from CDK
run: ./script/ci
working-directory: cdk
- uses: sbt/setup-sbt@v1
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: "21"
distribution: "corretto"
cache: sbt
# There are two separate build in the support-workers project
# - the integration tests build which is uploaded so it can be run in a lambda
# - the support-workers build
- name: Build integration test assembly
run: |
sbt "project support-workers" it:assembly
- name: Build support-workers assembly
run: |
sbt "project support-workers" test assembly
- name: Upload to riff-raff
uses: guardian/actions-riff-raff@v4
with:
projectName: support:support-workers-mono
roleArn: ${{ secrets.GU_RIFF_RAFF_ROLE_ARN }}
githubToken: ${{ secrets.GITHUB_TOKEN }}
buildNumberOffset: 12000
config: |
stacks: [support]
regions: [eu-west-1]
allowedStages:
- CODE
- PROD
deployments:
cfn:
type: cloud-formation
app: workers
parameters:
templateStagePaths:
CODE: SupportWorkers-CODE.template.json
PROD: SupportWorkers-PROD.template.json
support-workers:
type: aws-lambda
parameters:
functionNames:
- "-CreatePaymentMethodLambda-"
- "-CreateSalesforceContactLambda-"
- "-CreateZuoraSubscriptionLambda-"
- "-SendThankYouEmailLambda-"
- "-UpdateSupporterProductDataLambda-"
- "-FailureHandlerLambda-"
- "-SendAcquisitionEventLambda-"
- "-PreparePaymentMethodForReuseLambda-"
fileName: support-workers.jar
dependencies: [cfn]
it-tests:
type: aws-s3
parameters:
cacheControl: private
publicReadAcl: false
contentDirectories: |
cfn:
- cdk/cdk.out/SupportWorkers-CODE.template.json
- cdk/cdk.out/SupportWorkers-PROD.template.json
support-workers:
- support-workers/target/scala-2.13/support-workers.jar
it-tests:
- support-workers/target/scala-2.13/support-workers-it.jar