Skip to content

Commit

Permalink
chore(ci): adding in braze and client api
Browse files Browse the repository at this point in the history
  • Loading branch information
bassrock committed Aug 16, 2024
1 parent 96bcb11 commit 8cabf6a
Show file tree
Hide file tree
Showing 8 changed files with 85 additions and 16 deletions.
5 changes: 5 additions & 0 deletions .github/actions/containerize/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ inputs:
app-path:
description: 'The path of where the application is located in the monorepo ie servers/<app-name>'
required: true
context:
description: 'The path of where to build from'
required: true
default: '.'
app-port:
description: 'The port the application runs on ie 4006'
required: true
Expand Down Expand Up @@ -67,6 +71,7 @@ runs:
with:
push: ${{inputs.push}}
tags: ${{inputs.docker-repo-name}}:${{ github.sha }}
context: ${{ inputs.context }}
build-args: |
GIT_SHA=${{ github.sha }}
SCOPE=${{inputs.scope}}
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/account-data-deleter.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
name: Account Data Deleter
on:
# Only run the tests for this service when any of the following file paths change
pull_request:
paths:
- 'infrastructure/account-data-deleter/**'
Expand All @@ -18,25 +17,20 @@ on:
- dev

jobs:
# Let's test the service against some real life and mocked docker services.
test-integrations:
# Only run this job on a pull request event
if: github.event_name == 'pull_request'
# Use our re-usable test integrations workflow which will use our docker compose file
uses: ./.github/workflows/reuse-test-integrations.yml
with:
scope: account-data-deleter
secrets: inherit

# It's infrastructure time, run the infrastructure update commands
infrastructure:
uses: ./.github/workflows/reuse-infrastructure.yml
with:
scope: account-data-deleter-cdk
stack-output-path: infrastructure/account-data-deleter/cdktf.out/stacks/account-data-deleter
secrets: inherit

# Let's try building and conidtionally pushing our docker image to the necessary account.
api:
uses: ./.github/workflows/reuse-build-and-push-image.yml
needs: [infrastructure]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/annotations-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
uses: ./.github/workflows/reuse-apollo-federation.yml
with:
federated-graph-name: pocket-client-api
graph-name: list
graph-name: annotations-api
schema-file-path: servers/annotations-api/dist/schema-generated.graphql
prod-graph-url: https://annotations-api.readitlater.com
dev-graph-url: https://annotations-api.getpocket.dev
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/braze.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Braze
on:
pull_request:
paths:
- 'infrastructure/braze/**'
- 'packages/**'
- 'pnpm-lock.yaml'
- '.github/actions/**'
- '.github/workflows/braze.yml'
- '.github/workflows/reuse-*.yml'
push:
branches:
- main
- dev

jobs:

infrastructure:
uses: ./.github/workflows/reuse-infrastructure.yml
with:
scope: braze-cdk
stack-output-path: infrastructure/braze/cdktf.out/stacks/braze
secrets: inherit
34 changes: 34 additions & 0 deletions .github/workflows/client-api.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Client API
on:
pull_request:
paths:
- 'infrastructure/client-api/**'
- 'packages/**'
- 'servers/client-api/**'
- 'pnpm-lock.yaml'
- '.github/actions/**'
- '.github/workflows/client-api.yml'
- '.github/workflows/reuse-*.yml'
push:
branches:
- main
- dev

jobs:

infrastructure:
uses: ./.github/workflows/reuse-infrastructure.yml
with:
scope: client-api-cdk
stack-output-path: infrastructure/client-api/cdktf.out/stacks/client-api
secrets: inherit

api:
uses: ./.github/workflows/reuse-build-and-push-image.yml
needs: [infrastructure]
with:
docker-repo-name-pattern: clientapi-{0}-app
context: servers/client-api
app-path: servers/client-api
terraform-output: ${{needs.infrastructure.outputs.terraform-output}}
secrets: inherit
4 changes: 0 additions & 4 deletions .github/workflows/list-api.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
name: List API
on:
# Only run the tests for this service when any of the following file paths change
pull_request:
paths:
- 'infrastructure/list-api/**'
Expand All @@ -16,10 +15,8 @@ on:
- dev

jobs:
# Let's test the service against some real life and mocked docker services.
test-integrations:
if: github.event_name == 'pull_request'
# Use our re-usable test integrations workflow which will use our docker compose file
uses: ./.github/workflows/reuse-test-integrations.yml
with:
scope: list-api
Expand All @@ -37,7 +34,6 @@ jobs:
secrets:
apollo-key: ${{ secrets.APOLLO_CLIENT_API_KEY }}

# It's infrastructure time, run the infrastructure update commands
infrastructure:
uses: ./.github/workflows/reuse-infrastructure.yml
with:
Expand Down
18 changes: 14 additions & 4 deletions .github/workflows/reuse-build-and-push-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ on:
inputs:
scope:
description: 'Turbo Repo scope to run the build for'
required: true
required: false
default: ''
type: string
docker-repo-name-pattern:
description: 'Docker name of the repo, usually: servicename-{0}-app. {0} is replaced with dev or prod'
Expand All @@ -18,13 +19,20 @@ on:
description: 'AWS Development Account Id'
type: string
default: 996905175585.dkr.ecr.us-east-1.amazonaws.com
context:
description: 'The path of where the application should be built from'
required: false
default: '.'
type: string
app-path:
description: 'The path of where the application is located in the monorepo ie servers/<app-name>'
required: true
required: false
default: ''
type: string
app-port:
description: 'The port the application runs on ie 4006'
required: true
required: false
default: 80
type: number
sentry-org:
description: 'The org name used in sentry. Used to upload source maps'
Expand All @@ -33,7 +41,8 @@ on:
default: pocket
sentry-project:
description: 'The project name used in sentry. Used to upload source maps'
required: true
required: false
default: ''
type: string
terraform-output:
description: 'The terraform output which is used to get the ECS_Service and Task Defintion arns for codedeploy'
Expand All @@ -60,6 +69,7 @@ jobs:
docker-repo-name: "${{inputs.development-aws-registry }}/${{ format(inputs.docker-repo-name-pattern, 'dev') }}"
app-path: ${{inputs.app-path}}
app-port: ${{inputs.app-port}}
context: ${{inputs.context}}
sentry-project: ${{inputs.sentry-project}}
sentry-org: ${{inputs.sentry-org}}
sentry-token: ${{secrets.SENTRY_BEARER}}
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/status-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@
name: Status Checks
on:
workflow_run:
workflows: [ Pull Request, User API, List API, Account Delete Monitor, Annotations API ]
workflows:
- Pull Request
- User API
- List API
- Account Delete Monitor
- Annotations API
- Braze
- Client API
types: [ completed ]

jobs:
Expand Down

0 comments on commit 8cabf6a

Please sign in to comment.