Skip to content

Commit

Permalink
Merge pull request #717 from fargito/feat/cdk-gc
Browse files Browse the repository at this point in the history
feat(cdk): add garbage collection for cdk assets
  • Loading branch information
fargito authored Nov 9, 2024
2 parents 4bb3a27 + a011f3b commit 03fef8e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/merge-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ jobs:

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: 💾 Cache Nx cache
id: package-cache
uses: actions/cache@v4
Expand All @@ -57,16 +58,24 @@ jobs:
nx-cache
# Cache will be updated at every run: https://github.com/actions/cache/blob/main/workarounds.md#update-a-cache
key: ${{ runner.os }}-nx-cache-${{ steps.setup-node.outputs.node-version }}-${{ github.run_id }}

- name: '🏗 Package'
run: pnpm nx affected --targets=package,build --parallel=2

- name: '🧪 Run tests'
run: pnpm nx affected --targets=test-linter,test-type,test-unit,test-circular,test-cdk --parallel=2

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ${{ env.AWS_REGION }}
role-to-assume: ${{ secrets.AWS_DEPLOY_ROLE_STAGING }}

- name: '🚀 Deploy staging'
run: pnpm nx affected --target=deploy-staging --parallel=2

- name: '🔎 Run integration tests on staging'
run: SLS_ENV=staging pnpm nx affected --target=test-integration --parallel=2

- name: '🧹 Clean Unused CDK assets'
run: pnpm nx affected --target=cdk-gc
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ jobs:
- name: '🔎 Run integration tests on production'
run: SLS_ENV=production pnpm nx affected --target=test-integration --parallel=2

- name: '🧹 Clean Unused CDK assets'
run: pnpm nx affected --target=cdk-gc

- name: Get latest release matching release tag type
id: get-latest-release
uses: rez0n/actions-github-release@main
Expand Down
3 changes: 0 additions & 3 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

pnpm commitlint --edit $1
3 changes: 0 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

pnpm lint-staged
1 change: 1 addition & 0 deletions services/validation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"bootstrap": "cdk bootstrap --profile event-scout-developer",
"bootstrap-production": "cdk bootstrap --context stage=production",
"bootstrap-staging": "cdk bootstrap --context stage=staging",
"cdk-gc": "cdk gc --unstable='gc' --type='s3' --created-buffer-days=1 --confirm=false",
"deploy": "cdk deploy --profile event-scout-developer",
"deploy-production": "cdk deploy --context stage=production",
"deploy-staging": "cdk deploy --context stage=staging",
Expand Down

0 comments on commit 03fef8e

Please sign in to comment.