Skip to content

Merge pull request #182 from guardian/dependabot/npm_and_yarn/dotenv-… #406

Merge pull request #182 from guardian/dependabot/npm_and_yarn/dotenv-…

Merge pull request #182 from guardian/dependabot/npm_and_yarn/dotenv-… #406

Workflow file for this run

name: Build support-reminders
on:
pull_request:
branches:
- main
push:
branches:
- main
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
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Env
run: env
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: './.nvmrc'
cache: 'yarn'
- name: Yarn
run: |
yarn clean
yarn install
yarn run build
- name: Run unit tests
run: yarn test --silent
env:
TEST_DB_URL: postgresql://localhost/postgres
TEST_DB_USER: postgres
TEST_DB_PASSWORD: postgres
- name: Copy files to Riff Raff package
run: cp package.json riff-raff.yaml target
- name: Yarn install in package
working-directory: ./target
run: yarn install --production
- name: Zip target directory contents (quietly)
run: zip -qr ../support-reminders.zip ./*
working-directory: ./target
- 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@v4
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: support-reminders
configPath: ./riff-raff.yaml
contentDirectories: |
support-reminders-cloudformation:
- ./cdk/cdk.out/SupportReminders-CODE.template.json
- ./cdk/cdk.out/SupportReminders-PROD.template.json
support-reminders:
- ./support-reminders.zip