Skip to content

Commit

Permalink
Init
Browse files Browse the repository at this point in the history
  • Loading branch information
ottaway-c authored Oct 6, 2023
2 parents c04f759 + abd38fd commit 8177994
Show file tree
Hide file tree
Showing 69 changed files with 4,232 additions and 1 deletion.
54 changes: 54 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
permissions:
contents: read
id-token: write
on:
pull_request:
branches:
- dev
concurrency:
group: ${{ github.head_ref }}
cancel-in-progress: false
name: check
jobs:
build:
runs-on: ubuntu-latest
environment: check
env:
SERVICE: ${{ vars.SERVICE }}
CDK_DEFAULT_REGION: ${{ vars.CDK_DEFAULT_REGION }}
CDK_DEFAULT_ACCOUNT: ${{ vars.CDK_DEFAULT_ACCOUNT }}
TAG: ${{ github.event.pull_request.head.sha }}
name: build
steps:
- uses: actions/checkout@v3
- uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.100
- uses: actions/setup-node@v3
with:
node-version: 18
- run: npm ci
- name: Run detect stage
id: vars
run: |
echo "STAGE=$(echo ${{github.head_ref}} | sed -r 's/[^a-z0-9-]/-/gi' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
- run: npm run unit
- uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: arn:aws:iam::${{ env.CDK_DEFAULT_ACCOUNT }}:role/github-actions
role-duration-seconds: 900
aws-region: ${{ env.CDK_DEFAULT_REGION }}
- name: Run cdk deploy ecr stack
run: npx cdk deploy ${{ env.SERVICE }}-${{ env.STAGE }}-ecr --require-approval never
- name: Run login to aws ecr
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
with:
mask-password: "true"
- run: |
npm run build
npm run push
- name: Run cdk deploy app stack
run: npx cdk deploy ${{ env.SERVICE }}-${{ env.STAGE }}-app --require-approval never
- run: npm run integration
- run: npm run e2e
38 changes: 38 additions & 0 deletions .github/workflows/cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
permissions:
contents: read
id-token: write
on:
pull_request:
types: [closed]
branches:
- dev
name: cleanup
jobs:
build:
runs-on: ubuntu-latest
environment: check
env:
SERVICE: ${{ vars.SERVICE }}
CDK_DEFAULT_REGION: ${{ vars.CDK_DEFAULT_REGION }}
CDK_DEFAULT_ACCOUNT: ${{ vars.CDK_DEFAULT_ACCOUNT }}
TAG: ${{ github.sha }}
name: build
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- run: npm ci
- name: Run detect stage
id: vars
run: |
echo "STAGE=$(echo ${{github.head_ref}} | sed -r 's/[^a-z0-9-]/-/gi' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
- uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: arn:aws:iam::${{ env.CDK_DEFAULT_ACCOUNT }}:role/github-actions
role-duration-seconds: 900
aws-region: ${{ env.CDK_DEFAULT_REGION }}
- name: Run cdk destroy
run: |
npx cdk destroy ${{ env.SERVICE }}-${{ env.STAGE }}-app --force
npx cdk destroy ${{ env.SERVICE }}-${{ env.STAGE }}-ecr --force
49 changes: 49 additions & 0 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
permissions:
contents: read
id-token: write
on:
push:
branches:
- dev
concurrency:
group: ${{ github.ref }}
cancel-in-progress: false
name: dev
jobs:
build:
runs-on: ubuntu-latest
environment: dev
env:
SERVICE: ${{ vars.SERVICE }}
STAGE: dev
CDK_DEFAULT_REGION: ${{ vars.CDK_DEFAULT_REGION }}
CDK_DEFAULT_ACCOUNT: ${{ vars.CDK_DEFAULT_ACCOUNT }}
TAG: ${{ github.sha }}
name: build
steps:
- uses: actions/checkout@v3
- uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.100
- uses: actions/setup-node@v3
with:
node-version: 18
- run: npm ci
- uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: arn:aws:iam::${{ env.CDK_DEFAULT_ACCOUNT }}:role/github-actions
role-duration-seconds: 900
aws-region: ${{ env.CDK_DEFAULT_REGION }}
- name: Run cdk deploy ecr stack
run: npx cdk deploy ${{ env.SERVICE }}-${{ env.STAGE }}-ecr --require-approval never
- name: Run login to aws ecr
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
with:
mask-password: "true"
- run: |
npm run build
npm run push
- name: Run cdk deploy app stack
run: npx cdk deploy ${{ env.SERVICE }}-${{ env.STAGE }}-app --require-approval never
- run: npm run e2e
49 changes: 49 additions & 0 deletions .github/workflows/prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
permissions:
contents: read
id-token: write
on:
push:
branches:
- main
concurrency:
group: prod
cancel-in-progress: false
name: prod
jobs:
build:
runs-on: ubuntu-latest
environment: prod
env:
SERVICE: ${{ vars.SERVICE }}
STAGE: prod
CDK_DEFAULT_REGION: ${{ vars.CDK_DEFAULT_REGION }}
CDK_DEFAULT_ACCOUNT: ${{ vars.CDK_DEFAULT_ACCOUNT }}
TAG: ${{ github.sha }}
name: build
steps:
- uses: actions/checkout@v3
- uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.100
- uses: actions/setup-node@v3
with:
node-version: 18
- run: npm ci
- uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: arn:aws:iam::${{ env.CDK_DEFAULT_ACCOUNT }}:role/github-actions
role-duration-seconds: 900
aws-region: ${{ env.CDK_DEFAULT_REGION }}
- name: Run cdk deploy ecr stack
run: npx cdk deploy ${{ env.SERVICE }}-${{ env.STAGE }}-ecr --require-approval never
- name: Run login to aws ecr
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
with:
mask-password: "true"
- run: |
npm run build
npm run push
- name: Run cdk deploy app stack
run: npx cdk deploy ${{ env.SERVICE }}-${{ env.STAGE }}-app --require-approval never
- run: npm run e2e
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
*.js
!jest.config.js
*.d.ts
node_modules

# CDK asset staging directory
.cdk.staging
cdk.out

.env

.idea
.vs
src/**/bin
src/**/obj
.build
*.user
17 changes: 17 additions & 0 deletions .run/docker-compose.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="docker-compose" type="docker-deploy" factoryName="docker-compose.yml" server-name="Docker">
<deployment type="docker-compose.yml">
<settings>
<option name="envFilePath" value="" />
<option name="secondarySourceFiles">
<list>
<option value="docker-compose.yml" />
</list>
</option>
<option name="sourceFilePath" value="docker-compose.override.yml" />
</settings>
</deployment>
<EXTENSION ID="com.jetbrains.rider.docker.debug" isFastModeEnabled="true" isSslEnabled="true" />
<method v="2" />
</configuration>
</component>
Loading

0 comments on commit 8177994

Please sign in to comment.