-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a43c887
commit 100c68a
Showing
27 changed files
with
1,641 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: Build typescript-lambda-hello-world | ||
|
||
on: | ||
- push | ||
|
||
jobs: | ||
CI: | ||
if: github.repository_owner == 'guardian' | ||
# Required by actions-assume-aws-role | ||
permissions: | ||
id-token: write | ||
contents: read | ||
name: support-reminders build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Env | ||
run: env | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: 'handlers/TypescriptHelloWorld1/.nvmrc' | ||
cache: 'yarn' | ||
|
||
- name: Yarn | ||
run: | | ||
yarn clean | ||
yarn install | ||
yarn run build | ||
working-directory: handlers/TypescriptHelloWorld1 | ||
|
||
- name: Copy files to Riff Raff package | ||
run: cp package.json riff-raff.yaml dist | ||
working-directory: handlers/TypescriptHelloWorld1 | ||
|
||
- name: Zip target directory contents (quietly) | ||
run: zip -qr ../typescript-lambda-hello-world.zip ./* | ||
working-directory: handlers/TypescriptHelloWorld1/dist | ||
|
||
- name: Yarn (CDK) | ||
working-directory: cdk | ||
run: | | ||
yarn install | ||
yarn tsc | ||
yarn lint | ||
yarn test | ||
- name: Yarn synth (CDK) | ||
working-directory: cdk | ||
run: yarn synth | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v2 | ||
with: | ||
aws-region: eu-west-1 | ||
role-to-assume: ${{ secrets.GU_RIFF_RAFF_ROLE_ARN }} | ||
|
||
- name: Upload to Riff-Raff | ||
uses: guardian/actions-riff-raff@v2 | ||
with: | ||
app: typescript-lambda-hello-world | ||
configPath: ./riff-raff.yaml | ||
contentDirectories: | | ||
typescript-lambda-hello-world-cloudformation: | ||
- ./cdk/cdk.out/typescript-lambda-hello-world-DEV.template.json | ||
typescript-lambda-hello-world: | ||
- handlers/TypescriptHelloWorld1/typescript-lambda-hello-world.zip |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
//import { join } from 'path'; | ||
import { GuScheduledLambda } from '@guardian/cdk'; | ||
import type { GuStackProps } from '@guardian/cdk/lib/constructs/core'; | ||
import { GuStack } from '@guardian/cdk/lib/constructs/core'; | ||
import type { App } from 'aws-cdk-lib'; | ||
import { Runtime } from 'aws-cdk-lib/aws-lambda'; | ||
|
||
export class TypescriptLambdaHelloWorld extends GuStack { | ||
constructor(scope: App, id: string, props: GuStackProps) { | ||
super(scope, id, props); | ||
|
||
const app = 'typescript-lambda-hello-world'; | ||
const nationalDeliveryFulfilmentLambda = new GuScheduledLambda( | ||
this, | ||
'typescript-lambda-hello-world', | ||
{ | ||
description: 'A first effort at making a typescript lamba', | ||
functionName: `membership-typescript-lambda-hello-world-DEV`, | ||
handler: 'typescript-lambda-hello-world/index.main', | ||
runtime: Runtime.NODEJS_18_X, | ||
memorySize: 1024, | ||
fileName: `typescript-lambda-hello-world.zip`, | ||
app: app, | ||
rules: [], | ||
monitoringConfiguration: { noMonitoring: true }, | ||
}, | ||
); | ||
} | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
18 |
Oops, something went wrong.