initial commit - wip #1
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
name: CI (New) | ||
on: | ||
pull_request: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
build-cfn-templates: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
contents: read | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
role-to-assume: ${{ secrets.GU_RIFF_RAFF_ROLE_ARN }} | ||
aws-region: eu-west-1 | ||
- name: Generate CFN templates from GuCDK | ||
run: bash ./script/cfn.sh | ||
gu-cdk-build: | ||
needs: build-cfn-templates | ||
strategy: | ||
matrix: | ||
subproject: | ||
- batch-email-sender | ||
- new-product-api | ||
- single-contribution-salesforce-writes | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
contents: read | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
role-to-assume: ${{ secrets.GU_RIFF_RAFF_ROLE_ARN }} | ||
aws-region: eu-west-1 | ||
- name: Setup Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'corretto' | ||
java-version: '11' | ||
cache: 'sbt' | ||
- name: Run tests and build subproject JAR | ||
run: sbt "project ${{ matrix.subproject }}" test assembly | ||
- name: Generate CFN templates from GuCDK | ||
run: bash ./script/cfn.sh | ||
- name: Upload to Riff-Raff | ||
uses: guardian/actions-riff-raff@v2 | ||
with: | ||
projectName: support-service-lambdas::${{ matrix.subproject }} | ||
buildNumberOffset: 7000 | ||
configPath: ./handlers/${{ matrix.subproject }}/riff-raff.yaml | ||
contentDirectories: | | ||
${{ matrix.subproject }}-cloudformation: | ||
- ./cdk/cdk.out/${{ matrix.subproject }}-CODE.template.json | ||
- ./cdk/cdk.out/${{ matrix.subproject }}-PROD.template.json | ||
${{ matrix.subproject }}: | ||
- ./handlers/${{ matrix.subproject }}/target/scala-2.13/${{ matrix.subproject }}.jar |