Scheduled check infrastructure #123
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_main_workshop: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - name: Setup NodeJS | |
| uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 | |
| with: | |
| node-version: 20 | |
| - name: Setup dependencies for main workshop | |
| working-directory: main-workshop/infrastructure | |
| run: npm ci | |
| - name: Synth main workshop infrastructure | |
| working-directory: main-workshop/infrastructure | |
| run: npm run cdk synth -- --c CI=true | |
| run_cdk_nag_api_workshop: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - name: Setup NodeJS | |
| uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 | |
| with: | |
| node-version: 20 | |
| - name: Setup dependencies for api workshop | |
| working-directory: api-workshop | |
| run: npm ci | |
| - name: Synth api workshop infrastructure | |
| working-directory: api-workshop | |
| run: npm run infra:synth -- --c CI=true |