Scheduled check infrastructure #111
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Scheduled check infrastructure | |
# PROCESS | |
# | |
# This workflow is run on a scheduled basis to check that the infrastructure stack and the IDE stack are compliant with the cdk_nag rules. | |
# | |
# 1. Setup codebase and dependencies | |
# 2. Run the CDK synth command to generate the CloudFormation template for the infrastructure stack | |
# 3. Run the CDK synth command to generate the CloudFormation template for the IDE stack | |
# USAGE | |
# | |
# NOTE: meant to use as a scheduled task only (or manually for debugging purposes). | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 9 * * 1' | |
permissions: | |
contents: read | |
jobs: | |
run_cdk_nag: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
- name: Setup NodeJS | |
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | |
with: | |
node-version: 20 | |
cache: "npm" | |
- name: Setup dependencies | |
run: npm ci | |
- name: Synth infrastructure | |
run: npm run infra:synth -- --c CI=true | |
- name: Synth IDE stack | |
run: npm run ide:synth -- --c CI=true |