-
Notifications
You must be signed in to change notification settings - Fork 13
112 lines (100 loc) Β· 3.34 KB
/
support-workers-build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
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