Skip to content

Migrate build to GitHub actions #5

Migrate build to GitHub actions

Migrate build to GitHub actions #5

Workflow file for this run

name: Build
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
# allow queued workflows to interrupt previous runs
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true
permissions:
id-token: write
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: corretto
cache: sbt
java-version: 11
- uses: actions/setup-node@v3
with:
cache: npm
cache-dependency-path: cdk/package-lock.json
node-version-file: .nvmrc
- uses: aws-actions/configure-aws-credentials@v2
with:
aws-region: eu-west-1
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
# - name: Login to ECR
# uses: aws-actions/amazon-ecr-login@v1
# with:
# mask-password: 'true'
- name: Compile and test
run: sbt compile test
- name: Build docker image
run: sbt docker:publishLocal
- name: Publish docker image
run: ./deploy.sh
env:
NOTIFICATION_LAMBDA_REPOSITORY_ID: ${{ secrets.NOTIFICATION_LAMBDA_REPOSITORY_ID }}
NOTIFICATION_LAMBDA_REPOSITORY_URL: ${{ secrets.NOTIFICATION_LAMBDA_REPOSITORY_URL }}
BUILD_NUMBER: ${{ github.run_number }}
- name: Cdk synth
run: |
set -e
if [ -e cdk/ ]
then
echo "CDK detected"
source ~/.nvm/nvm.sh
nvm install
nvm use
(
echo "Running CDK CI steps"
cd cdk
npm ci
npm run lint
npm test
npm run synth
)
else
echo "No CDK - skipping"
fi
- name: Upload to riff-raff
run: sbt riffRaffUpload