Skip to content

Commit

Permalink
cli=5.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hei-teacher committed Dec 12, 2023
0 parents commit 6c5c297
Show file tree
Hide file tree
Showing 72 changed files with 2,647 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/cd-compute-permission.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: CD compute permission

on:
push:
branches:
- 'prod'
- 'preprod'

workflow_dispatch:

jobs:
cd-event:
if: github.ref_name == 'prod' || github.ref_name == 'preprod'

runs-on: ubuntu-latest

timeout-minutes: 20

env:
AWS_REGION: eu-west-3

steps:
- name: Checkout
uses: actions/[email protected]

- uses: hei-school/[email protected]
with:
secrets: ${{ toJSON(secrets) }}
region: ${{ env.AWS_REGION }}

- name: Deploy permission stack
uses: aws-actions/aws-cloudformation-github-deploy@v1
with:
name: ${{ github.ref_name }}-permission-poja-base
template: cf-stacks/compute-permission-stack.yml
tags: "[ { \"Key\": \"app\", \"Value\": \"poja-base\" }, { \"Key\": \"env\", \"Value\": \"${{ github.ref_name }}\" } ]"
capabilities: CAPABILITY_NAMED_IAM
no-fail-on-empty-changeset: "1"
parameter-overrides:
"Env=${{ github.ref_name }}"
38 changes: 38 additions & 0 deletions .github/workflows/cd-compute.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: CD compute

on:
push:
branches:
- 'prod'
- 'preprod'

workflow_dispatch:

workflow_call:

jobs:
deploy-api:
if: ${{ github.ref_name == 'prod' || github.ref_name == 'preprod' }}
runs-on: ubuntu-latest
timeout-minutes: 15

env:
AWS_REGION: eu-west-3

steps:
- uses: actions/[email protected]

- uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'corretto'

- uses: hei-school/[email protected]
with:
secrets: ${{ toJSON(secrets) }}
region: ${{ env.AWS_REGION }}

- run: sam build

- name: Deploy application
run: sam deploy --no-confirm-changeset --no-fail-on-empty-changeset --stack-name ${{ github.ref_name }}-compute-poja-base --capabilities CAPABILITY_IAM --parameter-overrides Env=${{ github.ref_name }} --resolve-s3
40 changes: 40 additions & 0 deletions .github/workflows/cd-event.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: CD event

on:
push:
branches:
- 'prod'
- 'preprod'

workflow_dispatch:

jobs:
cd-event:
if: github.ref_name == 'prod' || github.ref_name == 'preprod'

runs-on: ubuntu-latest

timeout-minutes: 20

env:
AWS_REGION: eu-west-3

steps:
- name: Checkout
uses: actions/[email protected]

- uses: hei-school/[email protected]
with:
secrets: ${{ toJSON(secrets) }}
region: ${{ env.AWS_REGION }}

- name: Deploy event stack
uses: aws-actions/aws-cloudformation-github-deploy@v1
with:
name: ${{ github.ref_name }}-event-poja-base
template: cf-stacks/event-stack.yml
tags: "[ { \"Key\": \"app\", \"Value\": \"poja-base\" }, { \"Key\": \"env\", \"Value\": \"${{ github.ref_name }}\" } ]"
capabilities: CAPABILITY_NAMED_IAM
no-fail-on-empty-changeset: "1"
parameter-overrides:
"Env=${{ github.ref_name }}"
39 changes: 39 additions & 0 deletions .github/workflows/cd-storage-bucket.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CD storage bucket

on:
push:
branches:
- 'prod'
- 'preprod'

workflow_dispatch:

jobs:
cd-storage:
if: github.ref_name == 'prod' || github.ref_name == 'preprod'

runs-on: ubuntu-latest

timeout-minutes: 20

env:
AWS_REGION: eu-west-3

steps:
- uses: actions/[email protected]

- uses: hei-school/[email protected]
with:
secrets: ${{ toJSON(secrets) }}
region: ${{ env.AWS_REGION }}

- name: Deploy bucket stack
uses: aws-actions/aws-cloudformation-github-deploy@v1
with:
name: ${{ github.ref_name }}-bucket-poja-base
template: cf-stacks/storage-bucket-stack.yml
tags: "[ { \"Key\": \"app\", \"Value\": \"poja-base\" }, { \"Key\": \"env\", \"Value\": \"${{ github.ref_name }}\" } ]"
capabilities: CAPABILITY_NAMED_IAM
no-fail-on-empty-changeset: "1"
parameter-overrides:
"Env=${{ github.ref_name }}"
41 changes: 41 additions & 0 deletions .github/workflows/cd-storage-database.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: CD storage database

on:
push:
branches:
- 'prod'
- 'preprod'

workflow_dispatch:

jobs:
cd-storage:
if: github.ref_name == 'prod' || github.ref_name == 'preprod'

runs-on: ubuntu-latest

timeout-minutes: 20

env:
AWS_REGION: eu-west-3

steps:
- uses: actions/[email protected]

- uses: hei-school/[email protected]
with:
secrets: ${{ toJSON(secrets) }}
region: ${{ env.AWS_REGION }}

- name: Deploy storage database stack
uses: aws-actions/aws-cloudformation-github-deploy@v1
with:
# TODO: -storage- --> -database-. But it will BREAK backward compatibility.
name: ${{ github.ref_name }}-storage-poja-base
template: cf-stacks/storage-database-stack.yml
tags: "[ { \"Key\": \"app\", \"Value\": \"poja-base\" }, { \"Key\": \"env\", \"Value\": \"${{ github.ref_name }}\" } ]"
capabilities: CAPABILITY_NAMED_IAM
no-fail-on-empty-changeset: "1"
parameter-overrides:
"Env=${{ github.ref_name }},
ProdDbClusterTimeout=${{ vars.PROD_DB_CLUSTER_TIMEOUT }}"
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: CI

on:
push:
branches:
- '*'
pull_request:
branches:
- '*'
workflow_dispatch:

workflow_call:

jobs:
quality-check:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/[email protected]

- uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'corretto'

- run: ./gradlew test
24 changes: 24 additions & 0 deletions .github/workflows/health-check-email.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Health check email
on:
workflow_dispatch:
inputs:
to:
type: string
description: Email address
required: true
env:
AWS_REGION: eu-west-3

jobs:
check-email:
timeout-minutes: 300
runs-on: ubuntu-latest

steps:
- uses: actions/[email protected]
- uses: hei-school/[email protected]
with:
secrets: ${{ toJSON(secrets) }}
region: ${{ env.AWS_REGION }}

- run: sh .shell/checkHealth.sh ${{ github.ref_name }} /health/email?to=${{ inputs.to }}
54 changes: 54 additions & 0 deletions .github/workflows/health-check-infra.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Health check infra
on:
schedule:
- cron: '0 8 * * *'
workflow_dispatch:
push:
branches:
- 'prod'
pull_request:
branches:
- 'prod'

env:
AWS_REGION: eu-west-3

jobs:
check-sync-stack:
timeout-minutes: 300
runs-on: ubuntu-latest

steps:
- uses: actions/[email protected]
- uses: hei-school/[email protected]
with:
secrets: ${{ toJSON(secrets) }}
region: ${{ env.AWS_REGION }}

- run: sh .shell/checkHealth.sh ${{ github.ref_name }} /health/db

check-async-stack:
timeout-minutes: 300
runs-on: ubuntu-latest

steps:
- uses: actions/[email protected]
- uses: hei-school/[email protected]
with:
secrets: ${{ toJSON(secrets) }}
region: ${{ env.AWS_REGION }}

- run: sh .shell/checkHealth.sh ${{ github.ref_name }} /health/event

check-bucket:
timeout-minutes: 300
runs-on: ubuntu-latest

steps:
- uses: actions/[email protected]
- uses: hei-school/[email protected]
with:
secrets: ${{ toJSON(secrets) }}
region: ${{ env.AWS_REGION }}

- run: sh .shell/checkHealth.sh ${{ github.ref_name }} /health/bucket
Loading

0 comments on commit 6c5c297

Please sign in to comment.