Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate build to GitHub actions #1151

Merged
merged 47 commits into from
Aug 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
dfc7792
create build workflow
DavidLawes Aug 21, 2023
7e9967c
change node cache and path
DavidLawes Aug 21, 2023
5434600
def env vars for docker publish step
DavidLawes Aug 21, 2023
26362ae
login to ecr
DavidLawes Aug 21, 2023
200973d
use deploy.sh to connect and publish
DavidLawes Aug 21, 2023
5f150d2
check image tags
DavidLawes Aug 22, 2023
a5aa9c6
print out docker images
DavidLawes Aug 22, 2023
86d3ace
remove inline comment
DavidLawes Aug 22, 2023
c27ed78
try explicitly updating tag
DavidLawes Aug 22, 2023
35234a2
use riff raff role before upload
DavidLawes Aug 22, 2023
6e1dd52
use actions-riff-raff for event consumer
DavidLawes Aug 22, 2023
1e318be
create eventconsumer artifact
DavidLawes Aug 22, 2023
dfae3e0
split workflows
DavidLawes Aug 22, 2023
a4f9c54
update wildcard syntax
DavidLawes Aug 22, 2023
659b831
define package-lock path
DavidLawes Aug 22, 2023
d16e690
add missing colons
DavidLawes Aug 22, 2023
213c7b5
define workflows for all services
DavidLawes Aug 22, 2023
e7b42b9
Merge branch 'main' into LIVE-5304-migrate-build-to-github-actions
DavidLawes Aug 22, 2023
06d7cd2
remove pull request triggers
DavidLawes Aug 22, 2023
378555e
update schedule lambda assembly command
DavidLawes Aug 22, 2023
beb8a70
create template json for slo monitor
DavidLawes Aug 22, 2023
48d6fe5
update jar name for schedule lambda
DavidLawes Aug 22, 2023
6a9b114
generate debian package
DavidLawes Aug 23, 2023
0854f44
update trigger paths for notification app
DavidLawes Aug 23, 2023
5c8d4a8
update all debian packages
DavidLawes Aug 23, 2023
7896179
make compile test and assembly step project specific
DavidLawes Aug 23, 2023
236a77d
generate cdk for registration
DavidLawes Aug 23, 2023
fba03c2
remove sbt riffraff artifact
DavidLawes Aug 23, 2023
9134a0d
update trigger paths
DavidLawes Aug 23, 2023
4dd6d1d
update worker lambda workflow
DavidLawes Aug 23, 2023
175f37f
update template path for notification cfn
DavidLawes Aug 23, 2023
fe8d90d
update template path for report
DavidLawes Aug 23, 2023
b3baa0d
update project name for schedule lambda
DavidLawes Aug 23, 2023
8b9319b
remove superfluous branches wildcard
DavidLawes Aug 23, 2023
a5c37da
split worker lambda cdk synth into 2 steps
DavidLawes Aug 23, 2023
ef7a981
remove redundant script
DavidLawes Aug 23, 2023
8565702
add step to move event consumer jar to root
DavidLawes Aug 24, 2023
9e5d547
move jar to root for every assembly workflow
DavidLawes Aug 24, 2023
dc23182
test reporter with specs2 tests
DavidLawes Aug 24, 2023
8488d75
update test reports path
DavidLawes Aug 24, 2023
98c950f
remove test reporter for scala tests
DavidLawes Aug 24, 2023
c1dda93
define build number offset
DavidLawes Aug 24, 2023
f3cc396
update publish script for notification worker
DavidLawes Aug 24, 2023
8a12b2f
don't use set-env
DavidLawes Aug 24, 2023
eec7a68
remove rogue $
DavidLawes Aug 24, 2023
b4c63d0
update syntax
DavidLawes Aug 24, 2023
43e4e00
remove echo
DavidLawes Aug 24, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .github/workflows/event-consumer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Event consumer

on:
push:
paths:
- eventconsumer/**
- commoneventconsumer/**
- project/**
- build.sbt
- .github/workflows/event-consumer.yml
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: aws-actions/configure-aws-credentials@v2
with:
aws-region: eu-west-1
role-to-assume: ${{ secrets.GU_RIFF_RAFF_ROLE_ARN }}

- name: Compile, test and assembly
run: sbt "project eventconsumer" "compile" "test" "assembly"

- name: Copy jar to root
run: cp eventconsumer/target/scala-*/eventconsumer.jar .

- name: Upload to riff-raff
uses: guardian/actions-riff-raff@v2
with:
projectName: mobile-n10n:eventconsumer
buildNumberOffset: 4147
configPath: eventconsumer/riff-raff.yaml
contentDirectories: |
eventconsumer:
- eventconsumer.jar
mobile-notifications-eventconsumer-cfn:
- eventconsumer/cfn.yaml
57 changes: 57 additions & 0 deletions .github/workflows/fake-breaking-news.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Fake breaking news lambda

on:
push:
paths:
- fakebreakingnewslambda/**
- common/**
- commoneventconsumer/**
- api-models/**
- project/**
- build.sbt
- .github/workflows/fake-breaking-news.yml
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: aws-actions/configure-aws-credentials@v2
with:
aws-region: eu-west-1
role-to-assume: ${{ secrets.GU_RIFF_RAFF_ROLE_ARN }}

- name: Compile, test and assembly
run: sbt "project fakebreakingnewslambda" "compile" "test" "assembly"

- name: Copy jar to root
run: cp fakebreakingnewslambda/target/scala-*/fakebreakingnewslambda.jar .

- name: Upload to riff-raff
uses: guardian/actions-riff-raff@v2
with:
projectName: mobile-n10n:fakebreakingnewslambda
buildNumberOffset: 4147
configPath: fakebreakingnewslambda/riff-raff.yaml
contentDirectories: |
fakebreakingnewslambda:
- fakebreakingnewslambda.jar
fakebreakingnewslambda-cfn:
- fakebreakingnewslambda/fakebreakingnewslambda-cfn.yaml
55 changes: 55 additions & 0 deletions .github/workflows/football.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Football

on:
push:
paths:
- football/**
- api-models/**
- project/**
- build.sbt
- .github/workflows/football.yml
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: aws-actions/configure-aws-credentials@v2
with:
aws-region: eu-west-1
role-to-assume: ${{ secrets.GU_RIFF_RAFF_ROLE_ARN }}

- name: Compile, test and assembly
run: sbt "project football" "compile" "test" "assembly"

- name: Copy jar to root
run: cp football/target/scala-*/football.jar .

- name: Upload to riff-raff
uses: guardian/actions-riff-raff@v2
with:
projectName: mobile-n10n:football
buildNumberOffset: 4147
configPath: football/riff-raff.yaml
contentDirectories: |
football:
- football.jar
mobile-notifications-football-cfn:
- football/cfn.yaml
108 changes: 108 additions & 0 deletions .github/workflows/notification-worker-lambdas.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: Notification worker lambdas

on:
push:
paths:
- notificationworkerlambda/**
- common/**
- commoneventconsumer/**
- cdk/**
- project/**
- build.sbt
- .github/workflows/notification-worker-lambdas.yml
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 "project notificationworkerlambda" "compile" "test"

- name: Build docker image
run: sbt docker:publishLocal

- name: Publish docker image
run: |
BUILD_NUMBER_WITH_OFFSET=$(($BUILD_NUMBER+4147))
docker tag notificationworkerlambda:DEV $NOTIFICATION_LAMBDA_REPOSITORY_URL:$BUILD_NUMBER_WITH_OFFSET
docker push ${NOTIFICATION_LAMBDA_REPOSITORY_URL}:${BUILD_NUMBER_WITH_OFFSET}
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 (worker lambda cdk directory)
working-directory: notificationworkerlambda/cdk
run: |
yarn install
yarn test
yarn synth

- name: CDK synth (root cdk directory)
working-directory: cdk
run: |
npm install
npm run lint
npm test
npm run synth

- uses: aws-actions/configure-aws-credentials@v2
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:
projectName: mobile-n10n:notificationworkerlambda
buildNumberOffset: 4147
configPath: notificationworkerlambda/riff-raff.yaml
contentDirectories: |
mobile-notifications-harvester-cfn:
- notificationworkerlambda/harvester-cfn.yaml
mobile-notifications-workers-cfn:
- notificationworkerlambda/cdk/cdk.out/SenderWorkerStack-CODE.template.json
- notificationworkerlambda/cdk/cdk.out/SenderWorkerStack-PROD.template.json
mobile-notifications-topic-counter-cfn:
- notificationworkerlambda/topic-counter-cfn.yaml
mobile-notifications-registration-cleaning-worker-cfn:
- notificationworkerlambda/registration-cleaning-worker-cfn.yaml
mobile-notifications-expired-registration-cleaner-cfn:
- notificationworkerlambda/expired-registration-cleaner-cfn.yaml
registrations-db-proxy-cfn:
- cdk/cdk.out/RegistrationsDbProxy-CODE.template.json
- cdk/cdk.out/RegistrationsDbProxy-PROD.template.json
54 changes: 54 additions & 0 deletions .github/workflows/notification.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Notification

on:
push:
paths:
- notification/**
- common/**
- commoneventconsumer/**
- commonscheduleddynamodb/**
- project/**
- build.sbt
- .github/workflows/notification.yml
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: aws-actions/configure-aws-credentials@v2
with:
aws-region: eu-west-1
role-to-assume: ${{ secrets.GU_RIFF_RAFF_ROLE_ARN }}

- name: Compile, test and package
run: sbt "project notification" "compile" "test" "debian:packageBin"

- name: Upload to riff-raff
uses: guardian/actions-riff-raff@v2
with:
projectName: mobile-n10n:notification
buildNumberOffset: 4147
configPath: notification/conf/riff-raff.yaml
contentDirectories: |
notification:
- notification/target/notification_1.0-latest_all.deb
notification-cfn:
- notification/conf/notification.yaml
Loading
Loading