Skip to content

Merge pull request #6002 from guardian/generic-checkout-design #7235

Merge pull request #6002 from guardian/generic-checkout-design

Merge pull request #6002 from guardian/generic-checkout-design #7235

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: support-workers/cloud-formation/src/yarn.lock
- name: Install
run: yarn
working-directory: support-workers/cloud-formation/src
- name: Build the cloudformation
run: yarn run build-cfn
working-directory: support-workers/cloud-formation/src
- 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:
templatePath: cfn.yaml
support-workers:
type: aws-lambda
parameters:
bucket: support-workers-dist
functionNames:
- "-CreatePaymentMethodLambda-"
- "-CreateSalesforceContactLambda-"
- "-CreateZuoraSubscriptionLambda-"
- "-SendThankYouEmailLambda-"
- "-UpdateSupporterProductDataLambda-"
- "-FailureHandlerLambda-"
- "-SendAcquisitionEventLambda-"
- "-PreparePaymentMethodForReuseLambda-"
fileName: support-workers.jar
dependencies: [cfn]
it-tests:
type: aws-s3
parameters:
bucket: support-workers-dist
cacheControl: private
publicReadAcl: false
contentDirectories: |
cfn:
- support-workers/cloud-formation/target/cfn.yaml
support-workers:
- support-workers/target/scala-2.13/support-workers.jar
it-tests:
- support-workers/target/scala-2.13/support-workers-it.jar