Skip to content

Commit 93f83d1

Browse files
Merge in main
2 parents 6854c21 + 4fabd81 commit 93f83d1

18 files changed

Lines changed: 1493 additions & 14 deletions

File tree

.github/workflows/ci.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
workflow_dispatch:
9+
10+
jobs:
11+
build:
12+
name: Build and upload to riff-raff
13+
runs-on: ubuntu-latest
14+
permissions:
15+
id-token: write
16+
contents: read
17+
pull-requests: write
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
22+
23+
- name: Setup Bun
24+
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6
25+
with:
26+
bun-version-file: '.bun-version'
27+
28+
- name: Install dependencies
29+
run: bun install --frozen-lockfile
30+
31+
- name: Check pinned dependencies
32+
run: bun check:pinned-deps
33+
34+
- name: Check formatting
35+
run: bun format:check
36+
37+
- name: Lint
38+
run: bun lint
39+
40+
- name: Typecheck
41+
run: bun typecheck
42+
43+
- name: Test
44+
run: bun test
45+
46+
- name: Build application
47+
working-directory: src/apps/backend
48+
run: bun run build:placeholder
49+
50+
- name: Build and synth CDK
51+
working-directory: cdk
52+
run: |
53+
bun lint
54+
bun test
55+
bun synth
56+
57+
- name: Combine application and CDK into dist
58+
run: |
59+
mkdir -p dist/frontend
60+
cp -v src/apps/backend/dist/handler.js dist/
61+
cp -v src/apps/backend/placeholder-assets/index.html dist/frontend
62+
cd dist
63+
zip -r dispatch.zip .
64+
65+
- name: Upload to riff-raff
66+
uses: guardian/actions-riff-raff@ab360a150e2540439f7f675c37d170a2fd6c8604
67+
with:
68+
githubToken: ${{ secrets.GITHUB_TOKEN }}
69+
roleArn: ${{ secrets.GU_RIFF_RAFF_ROLE_ARN }}
70+
projectName: Editorial Tools::Dispatch
71+
configPath: cdk/cdk.out/riff-raff.yaml
72+
contentDirectories: |
73+
cdk.out:
74+
- cdk/cdk.out
75+
dispatch:
76+
- dist/dispatch.zip

bun.lock

Lines changed: 427 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cdk/.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
*.js
2+
!.eslintrc.js
3+
*.d.ts
4+
node_modules
5+
dist
6+
7+
# CDK asset staging directory
8+
.cdk.staging
9+
cdk.out

cdk/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Infrastructure
2+
3+
This directory defines the components to be deployed to AWS.
4+
5+
See [`package.json`](./package.json) for a list of available scripts.

cdk/bin/cdk.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import 'source-map-support/register';
2+
import { GuRoot } from '@guardian/cdk/lib/constructs/root';
3+
import { DispatchStack } from '../lib/notifications';
4+
5+
const app = new GuRoot();
6+
new DispatchStack(
7+
app,
8+
'Dispatch-euwest-1-CODE',
9+
{ stack: 'notifications', stage: 'CODE', env: { region: 'eu-west-1' } },
10+
'dispatch',
11+
);

cdk/cdk.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"app": "npx ts-node bin/cdk.ts",
3+
"context": {
4+
"aws-cdk:enableDiffNoFail": "true",
5+
"@aws-cdk/core:stackRelativeExports": "true"
6+
}
7+
}

cdk/eslint.config.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import guardian from '@guardian/eslint-config';
2+
3+
export default [...guardian.configs.recommended];

0 commit comments

Comments
 (0)