diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 50584b5..6e5615e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,7 +37,7 @@ jobs: - name: 'Create .env file' run: | - echo "${{ secrets.ENV_CI }}" > .env + echo "${{ vars.ENV_CI }}" > .env - name: Lint run: npm run lint @@ -71,7 +71,7 @@ jobs: - name: Create infrastructure .env file working-directory: ./infrastructure run: | - echo "${{ secrets.CDK_ENV_DEV }}" > .env + echo "${{ vars.CDK_ENV_DEV }}" > .env - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v6.0.0 diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index 03c9e89..1163eb1 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yml @@ -37,7 +37,7 @@ jobs: - name: 'Create .env file' run: | - echo "${{ secrets.ENV_CI }}" > .env + echo "${{ vars.ENV_CI }}" > .env - name: Run ESLint with detailed output run: | diff --git a/.github/workflows/deploy-dev.yml b/.github/workflows/deploy-dev.yml index 8131139..2721f68 100644 --- a/.github/workflows/deploy-dev.yml +++ b/.github/workflows/deploy-dev.yml @@ -19,6 +19,5 @@ jobs: with: aws_role_arn: ${{ vars.AWS_ROLE_ARN_DEV }} env: dev - secrets: - env_file: ${{ secrets.ENV_DEV }} - cdk_env_file: ${{ secrets.CDK_ENV_DEV }} + env_file: ${{ vars.ENV_DEV }} + cdk_env_file: ${{ vars.CDK_ENV_DEV }} diff --git a/.github/workflows/deploy-prod.yml b/.github/workflows/deploy-prod.yml index 3b4821a..d3e8509 100644 --- a/.github/workflows/deploy-prod.yml +++ b/.github/workflows/deploy-prod.yml @@ -19,6 +19,5 @@ jobs: with: aws_role_arn: ${{ vars.AWS_ROLE_ARN_PROD }} env: prod - secrets: - env_file: ${{ secrets.ENV_PROD }} - cdk_env_file: ${{ secrets.CDK_ENV_PROD }} + env_file: ${{ vars.ENV_PROD }} + cdk_env_file: ${{ vars.CDK_ENV_PROD }} diff --git a/.github/workflows/deploy-qa.yml b/.github/workflows/deploy-qa.yml index cdf5dc0..1c50b18 100644 --- a/.github/workflows/deploy-qa.yml +++ b/.github/workflows/deploy-qa.yml @@ -18,6 +18,5 @@ jobs: with: aws_role_arn: ${{ vars.AWS_ROLE_ARN_QA }} env: qa - secrets: - env_file: ${{ secrets.ENV_QA }} - cdk_env_file: ${{ secrets.CDK_ENV_QA }} + env_file: ${{ vars.ENV_QA }} + cdk_env_file: ${{ vars.CDK_ENV_QA }} diff --git a/.github/workflows/reusable-deploy.yml b/.github/workflows/reusable-deploy.yml index c9e7aed..2ec889e 100644 --- a/.github/workflows/reusable-deploy.yml +++ b/.github/workflows/reusable-deploy.yml @@ -4,20 +4,21 @@ on: workflow_call: inputs: aws_region: - required: false type: string + required: false default: 'us-east-1' aws_role_arn: - required: true type: string + required: true env: - required: false type: string + required: false default: 'dev' - secrets: env_file: + type: string required: true cdk_env_file: + type: string required: true jobs: @@ -46,7 +47,7 @@ jobs: - name: Create app .env file run: | - echo "${{ secrets.env_file }}" > .env + echo "${{ inputs.env_file }}" > .env echo "VITE_BUILD_DATE=$(date +'%Y-%m-%d')" >> .env echo "VITE_BUILD_TIME=$(date +'%H:%M:%S%z')" >> .env echo "VITE_BUILD_TS=$(date +'%Y-%m-%dT%H:%M:%S%z')" >> .env @@ -76,7 +77,7 @@ jobs: - name: Create infrastructure .env file working-directory: ./infrastructure run: | - echo "${{ secrets.cdk_env_file }}" > .env + echo "${{ inputs.cdk_env_file }}" > .env echo "✅ Infrastructure .env file created" - name: Build infrastructure diff --git a/docs/DEVOPS_GUIDE.md b/docs/DEVOPS_GUIDE.md index 854bcb8..724c20d 100644 --- a/docs/DEVOPS_GUIDE.md +++ b/docs/DEVOPS_GUIDE.md @@ -32,18 +32,24 @@ The project uses GitHub Actions for CI/CD. Below is a detailed description of ea - **Concurrency:** - Ensures only one workflow runs per branch/ref at a time; cancels in-progress runs for the same branch/ref. - **Timeout:** 10 minutes +- **Prerequisites:** + - GitHub Actions variables must be configured: + - `ENV_CI` - Application environment variables for CI + - `CDK_ENV_DEV` - CDK infrastructure environment configuration for DEV + - `AWS_ROLE_ARN_DEV` - AWS IAM Role ARN for development environment + - `AWS_REGION` - AWS region for deployment - **Main Steps:** 1. Checkout repository 2. Setup Node.js (from `.nvmrc`, with npm cache) 3. Install dependencies (`npm ci`) - 4. Create application `.env` file from secrets (`ENV_CI`) + 4. Create application `.env` file from variables (`ENV_CI`) 5. Lint code (`npm run lint`) 6. Check code formatting (`npm run format:check`) 7. Build application (`npm run build`) 8. Run unit tests with CI mode (`npm run test:ci`) 9. Build Storybook (`npm run build:storybook`) 10. Install and build infrastructure code - 11. Create infrastructure `.env` file from secrets (`CDK_ENV_DEV`) + 11. Create infrastructure `.env` file from variables (`CDK_ENV_DEV`) 12. Configure AWS credentials using OIDC (role: `AWS_ROLE_ARN_DEV`) 13. Synthesize CDK stacks (`npm run synth`) 14. Clean up sensitive files (`.env`, `cdk.out`) @@ -94,7 +100,6 @@ The project uses GitHub Actions for CI/CD. Below is a detailed description of ea - GitHub Actions variables must be configured: - `AWS_ROLE_ARN_DEV` - AWS IAM Role ARN for development environment - `AWS_REGION` - AWS region for deployment (default: `us-east-1`) - - GitHub Actions secrets must be configured: - `ENV_DEV` - Application environment variables - `CDK_ENV_DEV` - CDK infrastructure environment configuration - **Execution:** Calls the reusable `Deploy` workflow @@ -112,7 +117,6 @@ The project uses GitHub Actions for CI/CD. Below is a detailed description of ea - GitHub Actions variables must be configured: - `AWS_ROLE_ARN_QA` - AWS IAM Role ARN for QA environment - `AWS_REGION` - AWS region for deployment - - GitHub Actions secrets must be configured: - `ENV_QA` - Application environment variables - `CDK_ENV_QA` - CDK infrastructure environment configuration - **Execution:** Calls the reusable `Deploy` workflow @@ -130,7 +134,6 @@ The project uses GitHub Actions for CI/CD. Below is a detailed description of ea - GitHub Actions variables must be configured: - `AWS_ROLE_ARN_PROD` - AWS IAM Role ARN for production environment - `AWS_REGION` - AWS region for deployment - - GitHub Actions secrets must be configured: - `ENV_PROD` - Application environment variables - `CDK_ENV_PROD` - CDK infrastructure environment configuration - **Execution:** Calls the reusable `Deploy` workflow @@ -145,7 +148,6 @@ The project uses GitHub Actions for CI/CD. Below is a detailed description of ea - `aws_role_arn` - AWS IAM role ARN for the target environment (required) - `aws_region` - AWS region for deployment (default: `us-east-1`) - `env` - Environment name (dev, qa, prod; default: `dev`) -- **Secrets:** - `env_file` - Application environment variables (required) - `cdk_env_file` - CDK infrastructure environment configuration (required) - **Timeout:** 30 minutes @@ -195,11 +197,6 @@ GitHub Actions variables should be configured in the repository settings: - `AWS_ROLE_ARN_DEV` - AWS IAM role ARN for development - `AWS_ROLE_ARN_QA` - AWS IAM role ARN for QA - `AWS_ROLE_ARN_PROD` - AWS IAM role ARN for production - -### Secrets - -GitHub Actions secrets should be configured in the repository settings: - - `ENV_CI` - Environment variables for CI workflow (application) - `ENV_DEV` - Environment variables for DEV deployment (application) - `ENV_QA` - Environment variables for QA deployment (application) diff --git a/infrastructure/package-lock.json b/infrastructure/package-lock.json index c59c780..80d3e54 100644 --- a/infrastructure/package-lock.json +++ b/infrastructure/package-lock.json @@ -1,12 +1,12 @@ { "name": "react-starter-infrastructure", - "version": "1.0.0", + "version": "1.1.0-alhpa.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "react-starter-infrastructure", - "version": "1.0.0", + "version": "1.1.0-alhpa.1", "dependencies": { "aws-cdk-lib": "2.238.0", "constructs": "10.4.5", diff --git a/infrastructure/package.json b/infrastructure/package.json index 35698bd..4abc928 100644 --- a/infrastructure/package.json +++ b/infrastructure/package.json @@ -1,6 +1,6 @@ { "name": "react-starter-infrastructure", - "version": "1.0.0", + "version": "1.1.0-alhpa.1", "private": true, "scripts": { "build": "tsc", diff --git a/package-lock.json b/package-lock.json index 858736f..5b5cb98 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,29 +1,29 @@ { "name": "react-starter", - "version": "1.0.0", + "version": "1.1.0-alpha.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "react-starter", - "version": "1.0.0", + "version": "1.1.0-alpha.1", "license": "MIT", "dependencies": { - "@fortawesome/fontawesome-svg-core": "7.1.0", - "@fortawesome/free-regular-svg-icons": "7.1.0", - "@fortawesome/free-solid-svg-icons": "7.1.0", + "@fortawesome/fontawesome-svg-core": "7.2.0", + "@fortawesome/free-regular-svg-icons": "7.2.0", + "@fortawesome/free-solid-svg-icons": "7.2.0", "@fortawesome/react-fontawesome": "3.2.0", "@hookform/resolvers": "5.2.2", "@react-spring/web": "10.0.3", "@tailwindcss/vite": "4.1.18", - "@tanstack/react-query": "5.90.20", + "@tanstack/react-query": "5.90.21", "@tanstack/react-query-devtools": "5.91.3", "@tanstack/react-table": "8.21.3", "axios": "1.13.5", "class-variance-authority": "0.7.1", "clsx": "2.1.1", "dayjs": "1.11.19", - "i18next": "25.8.4", + "i18next": "25.8.5", "i18next-browser-languagedetector": "8.2.0", "lodash": "4.17.23", "qs": "6.14.1", @@ -56,7 +56,7 @@ "@types/react-dom": "19.2.3", "@types/react-syntax-highlighter": "15.5.13", "@types/uuid": "10.0.0", - "@vitejs/plugin-react": "5.1.3", + "@vitejs/plugin-react": "5.1.4", "@vitest/coverage-v8": "4.0.18", "@vitest/ui": "4.0.18", "eslint": "9.39.2", @@ -66,7 +66,7 @@ "globals": "17.3.0", "husky": "9.1.7", "jsdom": "28.0.0", - "msw": "2.12.9", + "msw": "2.12.10", "prettier": "3.8.1", "prettier-plugin-tailwindcss": "0.7.2", "rimraf": "6.1.2", @@ -1195,46 +1195,46 @@ } }, "node_modules/@fortawesome/fontawesome-common-types": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-7.1.0.tgz", - "integrity": "sha512-l/BQM7fYntsCI//du+6sEnHOP6a74UixFyOYUyz2DLMXKx+6DEhfR3F2NYGE45XH1JJuIamacb4IZs9S0ZOWLA==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-7.2.0.tgz", + "integrity": "sha512-IpR0bER9FY25p+e7BmFH25MZKEwFHTfRAfhOyJubgiDnoJNsSvJ7nigLraHtp4VOG/cy8D7uiV0dLkHOne5Fhw==", "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/@fortawesome/fontawesome-svg-core": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-7.1.0.tgz", - "integrity": "sha512-fNxRUk1KhjSbnbuBxlWSnBLKLBNun52ZBTcs22H/xEEzM6Ap81ZFTQ4bZBxVQGQgVY0xugKGoRcCbaKjLQ3XZA==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-svg-core/-/fontawesome-svg-core-7.2.0.tgz", + "integrity": "sha512-6639htZMjEkwskf3J+e6/iar+4cTNM9qhoWuRfj9F3eJD6r7iCzV1SWnQr2Mdv0QT0suuqU8BoJCZUyCtP9R4Q==", "license": "MIT", "peer": true, "dependencies": { - "@fortawesome/fontawesome-common-types": "7.1.0" + "@fortawesome/fontawesome-common-types": "7.2.0" }, "engines": { "node": ">=6" } }, "node_modules/@fortawesome/free-regular-svg-icons": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@fortawesome/free-regular-svg-icons/-/free-regular-svg-icons-7.1.0.tgz", - "integrity": "sha512-0e2fdEyB4AR+e6kU4yxwA/MonnYcw/CsMEP9lH82ORFi9svA6/RhDyhxIv5mlJaldmaHLLYVTb+3iEr+PDSZuQ==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@fortawesome/free-regular-svg-icons/-/free-regular-svg-icons-7.2.0.tgz", + "integrity": "sha512-iycmlN51EULlQ4D/UU9WZnHiN0CvjJ2TuuCrAh+1MVdzD+4ViKYH2deNAll4XAAYlZa8WAefHR5taSK8hYmSMw==", "license": "(CC-BY-4.0 AND MIT)", "dependencies": { - "@fortawesome/fontawesome-common-types": "7.1.0" + "@fortawesome/fontawesome-common-types": "7.2.0" }, "engines": { "node": ">=6" } }, "node_modules/@fortawesome/free-solid-svg-icons": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-7.1.0.tgz", - "integrity": "sha512-Udu3K7SzAo9N013qt7qmm22/wo2hADdheXtBfxFTecp+ogsc0caQNRKEb7pkvvagUGOpG9wJC1ViH6WXs8oXIA==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-7.2.0.tgz", + "integrity": "sha512-YTVITFGN0/24PxzXrwqCgnyd7njDuzp5ZvaCx5nq/jg55kUYd94Nj8UTchBdBofi/L0nwRfjGOg0E41d2u9T1w==", "license": "(CC-BY-4.0 AND MIT)", "dependencies": { - "@fortawesome/fontawesome-common-types": "7.1.0" + "@fortawesome/fontawesome-common-types": "7.2.0" }, "engines": { "node": ">=6" @@ -1687,9 +1687,9 @@ } }, "node_modules/@rolldown/pluginutils": { - "version": "1.0.0-rc.2", - "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-rc.2.tgz", - "integrity": "sha512-izyXV/v+cHiRfozX62W9htOAvwMo4/bXKDrQ+vom1L1qRuexPock/7VZDAhnpHCLNejd3NJ6hiab+tO0D44Rgw==", + "version": "1.0.0-rc.3", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-rc.3.tgz", + "integrity": "sha512-eybk3TjzzzV97Dlj5c+XrBFW57eTNhzod66y9HrBlzJ6NsCrWCp/2kaPS3K9wJmurBC0Tdw4yPjXKZqlznim3Q==", "dev": true, "license": "MIT" }, @@ -2528,9 +2528,9 @@ } }, "node_modules/@tanstack/react-query": { - "version": "5.90.20", - "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.90.20.tgz", - "integrity": "sha512-vXBxa+qeyveVO7OA0jX1z+DeyCA4JKnThKv411jd5SORpBKgkcVnYKCiBgECvADvniBX7tobwBmg01qq9JmMJw==", + "version": "5.90.21", + "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.90.21.tgz", + "integrity": "sha512-0Lu6y5t+tvlTJMTO7oh5NSpJfpg/5D41LlThfepTixPYkJ0sE2Jj0m0f6yYqujBwIXlId87e234+MxG3D3g7kg==", "license": "MIT", "peer": true, "dependencies": { @@ -3230,16 +3230,16 @@ } }, "node_modules/@vitejs/plugin-react": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-5.1.3.tgz", - "integrity": "sha512-NVUnA6gQCl8jfoYqKqQU5Clv0aPw14KkZYCsX6T9Lfu9slI0LOU10OTwFHS/WmptsMMpshNd/1tuWsHQ2Uk+cg==", + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-5.1.4.tgz", + "integrity": "sha512-VIcFLdRi/VYRU8OL/puL7QXMYafHmqOnwTZY50U1JPlCNj30PxCMx65c494b1K9be9hX83KVt0+gTEwTWLqToA==", "dev": true, "license": "MIT", "dependencies": { "@babel/core": "^7.29.0", "@babel/plugin-transform-react-jsx-self": "^7.27.1", "@babel/plugin-transform-react-jsx-source": "^7.27.1", - "@rolldown/pluginutils": "1.0.0-rc.2", + "@rolldown/pluginutils": "1.0.0-rc.3", "@types/babel__core": "^7.20.5", "react-refresh": "^0.18.0" }, @@ -5367,9 +5367,9 @@ } }, "node_modules/i18next": { - "version": "25.8.4", - "resolved": "https://registry.npmjs.org/i18next/-/i18next-25.8.4.tgz", - "integrity": "sha512-a9A0MnUjKvzjEN/26ZY1okpra9kA8MEwzYEz1BNm+IyxUKPRH6ihf0p7vj8YvULwZHKHl3zkJ6KOt4hewxBecQ==", + "version": "25.8.5", + "resolved": "https://registry.npmjs.org/i18next/-/i18next-25.8.5.tgz", + "integrity": "sha512-TApjhgqQU6P7BQlpCTv6zQuXrYAP9rjYWgx2Nm8dsq+Zg9yJlAz+iR16/w7uVtTlSoULbqPTfqYjMK/DAQI+Ng==", "funding": [ { "type": "individual", @@ -6314,9 +6314,9 @@ "license": "MIT" }, "node_modules/msw": { - "version": "2.12.9", - "resolved": "https://registry.npmjs.org/msw/-/msw-2.12.9.tgz", - "integrity": "sha512-NYbi51C6M3dujGmcmuGemu68jy12KqQPoVWGeroKToLGsBgrwG5ErM8WctoIIg49/EV49SEvYM9WSqO4G7kNeQ==", + "version": "2.12.10", + "resolved": "https://registry.npmjs.org/msw/-/msw-2.12.10.tgz", + "integrity": "sha512-G3VUymSE0/iegFnuipujpwyTM2GuZAKXNeerUSrG2+Eg391wW63xFs5ixWsK9MWzr1AGoSkYGmyAzNgbR3+urw==", "dev": true, "hasInstallScript": true, "license": "MIT", diff --git a/package.json b/package.json index 1136dee..a267c91 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ ], "author": "LeanStacks", "license": "MIT", - "version": "1.0.0", + "version": "1.1.0-alpha.1", "type": "module", "repository": { "type": "git", @@ -30,21 +30,21 @@ "test:ui": "vitest --ui --coverage --silent" }, "dependencies": { - "@fortawesome/fontawesome-svg-core": "7.1.0", - "@fortawesome/free-regular-svg-icons": "7.1.0", - "@fortawesome/free-solid-svg-icons": "7.1.0", + "@fortawesome/fontawesome-svg-core": "7.2.0", + "@fortawesome/free-regular-svg-icons": "7.2.0", + "@fortawesome/free-solid-svg-icons": "7.2.0", "@fortawesome/react-fontawesome": "3.2.0", "@hookform/resolvers": "5.2.2", "@react-spring/web": "10.0.3", "@tailwindcss/vite": "4.1.18", - "@tanstack/react-query": "5.90.20", + "@tanstack/react-query": "5.90.21", "@tanstack/react-query-devtools": "5.91.3", "@tanstack/react-table": "8.21.3", "axios": "1.13.5", "class-variance-authority": "0.7.1", "clsx": "2.1.1", "dayjs": "1.11.19", - "i18next": "25.8.4", + "i18next": "25.8.5", "i18next-browser-languagedetector": "8.2.0", "lodash": "4.17.23", "qs": "6.14.1", @@ -77,7 +77,7 @@ "@types/react-dom": "19.2.3", "@types/react-syntax-highlighter": "15.5.13", "@types/uuid": "10.0.0", - "@vitejs/plugin-react": "5.1.3", + "@vitejs/plugin-react": "5.1.4", "@vitest/coverage-v8": "4.0.18", "@vitest/ui": "4.0.18", "eslint": "9.39.2", @@ -87,7 +87,7 @@ "globals": "17.3.0", "husky": "9.1.7", "jsdom": "28.0.0", - "msw": "2.12.9", + "msw": "2.12.10", "prettier": "3.8.1", "prettier-plugin-tailwindcss": "0.7.2", "rimraf": "6.1.2",