184 monorepo structure #179
Workflow file for this run
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: CI | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| ci: | |
| name: Build, Lint, and Test | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| permissions: | |
| id-token: write | |
| contents: read | |
| steps: | |
| # --- Setup --- | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup Node.js environment | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: '.nvmrc' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: 'Create web .env file' | |
| working-directory: ./packages/web | |
| run: | | |
| echo "${{ vars.ENV_CI }}" > .env | |
| - name: Create infrastructure .env file | |
| working-directory: ./packages/infra | |
| run: | | |
| echo "${{ vars.CDK_ENV_DEV }}" > .env | |
| # --- Project Checks --- | |
| - name: Lint | |
| run: npm run lint | |
| - name: Check code formatting | |
| run: npm run format:check | |
| - name: Build | |
| run: npm run build | |
| - name: Run unit tests | |
| run: npm run test:coverage | |
| # --- Web Package Checks --- | |
| # --- Storybook Checks --- | |
| - name: Build Storybook | |
| run: npm run build:storybook -w packages/web | |
| # --- Infrastructure Package Checks --- | |
| - name: Configure AWS credentials | |
| uses: aws-actions/configure-aws-credentials@v6 | |
| with: | |
| role-to-assume: ${{ vars.AWS_ROLE_ARN_DEV }} | |
| role-session-name: ci-react-starter | |
| aws-region: ${{ vars.AWS_REGION }} | |
| - name: Synthesize AWS CDK stacks | |
| run: npm run synth -w packages/infra | |
| # --- Final Step: Clean up sensitive files --- | |
| - name: Clean up sensitive files | |
| if: always() | |
| run: | | |
| echo "🧹 Cleaning up sensitive files..." | |
| rm -f packages/web/.env | |
| rm -rf packages/web/dist | |
| rm -rf packages/web/storybook-static | |
| rm -f packages/infra/.env | |
| rm -rf packages/infra/dist | |
| rm -rf packages/infra/cdk.out | |
| rm -rf packages/shared/dist | |
| echo "✅ Sensitive files cleaned up" |