Skip to content

Merge pull request #202 from guardian/temp-remove-lambda-vpc #324

Merge pull request #202 from guardian/temp-remove-lambda-vpc

Merge pull request #202 from guardian/temp-remove-lambda-vpc #324

Workflow file for this run

name: CI
on:
pull_request:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
name: Build and upload to riff-raff
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
- name: Setup Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6
with:
bun-version-file: '.bun-version'
- name: Install dependencies
# Dependabot updates dependencies, which can change the lockfile.
# Allow it to install without --frozen-lockfile so the updated lockfile can be committed.
run: |
if [ "${{ github.actor }}" = "dependabot[bot]" ]; then
bun install
else
bun install --frozen-lockfile
fi
- name: Check pinned dependencies
run: bun check:pinned-deps
- name: Check formatting
run: bun format:check
- name: Lint
run: bun run lint
- name: Typecheck
run: bun typecheck
- name: Test
run: bun test
- name: Build application
working-directory: src/apps/backend
run: bun run build
- name: Build frontend assets
working-directory: src/apps/frontend
run: bun run build
- name: Build and synth CDK
working-directory: cdk
run: bun synth
- name: Combine application and CDK into dist
run: |
mkdir -p dist/frontend
cp -v src/apps/backend/dist/handler.js dist/
cp -Rv src/apps/frontend/dist/. dist/frontend/
cd dist
zip -r dispatch.zip .
- name: Upload to riff-raff
uses: guardian/actions-riff-raff@66d370310110786ae95856240dbb0a725e9d11c3
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
roleArn: ${{ secrets.GU_RIFF_RAFF_ROLE_ARN }}
projectName: Editorial Tools::Dispatch
configPath: cdk/cdk.out/riff-raff.yaml
contentDirectories: |
cdk.out:
- cdk/cdk.out
dispatch:
- dist/dispatch.zip
storybook-tests:
name: Storybook interaction tests
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
- name: Setup Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6
with:
bun-version-file: '.bun-version'
- name: Install dependencies
# Dependabot updates dependencies, which can change the lockfile.
# Allow it to install without --frozen-lockfile so the updated lockfile can be committed.
run: |
if [ "${{ github.actor }}" = "dependabot[bot]" ]; then
bun install
else
bun install --frozen-lockfile
fi
- name: Install Playwright browser
working-directory: src/apps/frontend
run: bunx playwright install --with-deps chromium
- name: Run Storybook tests
working-directory: src/apps/frontend
run: bun run test-storybook