|
| 1 | +name: Deploy all resources to PROD (Manual) |
| 2 | +run-name: Manual PROD deploy - @${{ github.actor }} |
| 3 | + |
| 4 | +on: |
| 5 | + workflow_dispatch: |
| 6 | + |
| 7 | +jobs: |
| 8 | + test: |
| 9 | + runs-on: ubuntu-latest |
| 10 | + timeout-minutes: 15 |
| 11 | + name: Run Unit Tests |
| 12 | + steps: |
| 13 | + - uses: actions/checkout@v4 |
| 14 | + env: |
| 15 | + HUSKY: "0" |
| 16 | + |
| 17 | + - name: Set up Node |
| 18 | + uses: actions/setup-node@v4 |
| 19 | + with: |
| 20 | + node-version: 22.x |
| 21 | + cache: "yarn" |
| 22 | + |
| 23 | + - name: Setup Terraform |
| 24 | + uses: hashicorp/setup-terraform@v2 |
| 25 | + with: |
| 26 | + terraform_version: 1.12.2 |
| 27 | + |
| 28 | + - name: Restore Yarn Cache |
| 29 | + uses: actions/cache@v4 |
| 30 | + with: |
| 31 | + path: node_modules |
| 32 | + key: yarn-modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-dev |
| 33 | + restore-keys: | |
| 34 | + yarn-modules-${{ runner.arch }}-${{ runner.os }}- |
| 35 | +
|
| 36 | + - name: Run unit testing |
| 37 | + run: make test_unit |
| 38 | + |
| 39 | + build: |
| 40 | + runs-on: ubuntu-24.04-arm |
| 41 | + timeout-minutes: 15 |
| 42 | + name: Build Application |
| 43 | + steps: |
| 44 | + - uses: actions/checkout@v4 |
| 45 | + env: |
| 46 | + HUSKY: "0" |
| 47 | + |
| 48 | + - name: Set up Node |
| 49 | + uses: actions/setup-node@v4 |
| 50 | + with: |
| 51 | + node-version: 22.x |
| 52 | + cache: "yarn" |
| 53 | + |
| 54 | + - name: Restore Yarn Cache |
| 55 | + uses: actions/cache@v4 |
| 56 | + with: |
| 57 | + path: node_modules |
| 58 | + key: yarn-modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-prod |
| 59 | + restore-keys: | |
| 60 | + yarn-modules-${{ runner.arch }}-${{ runner.os }}- |
| 61 | +
|
| 62 | + - name: Run build |
| 63 | + run: make build |
| 64 | + env: |
| 65 | + HUSKY: "0" |
| 66 | + VITE_RUN_ENVIRONMENT: prod |
| 67 | + RunEnvironment: prod |
| 68 | + VITE_BUILD_HASH: ${{ github.sha }} |
| 69 | + |
| 70 | + - name: Upload Build files |
| 71 | + uses: actions/upload-artifact@v4 |
| 72 | + with: |
| 73 | + include-hidden-files: true |
| 74 | + name: build-prod |
| 75 | + path: | |
| 76 | + .aws-sam/ |
| 77 | + dist/ |
| 78 | + dist_ui/ |
| 79 | +
|
| 80 | + deploy-prod: |
| 81 | + runs-on: ubuntu-latest |
| 82 | + timeout-minutes: 30 |
| 83 | + name: Deploy to Prod and Run Health Check |
| 84 | + concurrency: |
| 85 | + group: ${{ github.event.repository.name }}-prod |
| 86 | + cancel-in-progress: false |
| 87 | + permissions: |
| 88 | + id-token: write |
| 89 | + contents: read |
| 90 | + needs: |
| 91 | + - test |
| 92 | + - build |
| 93 | + environment: "AWS PROD" |
| 94 | + steps: |
| 95 | + - name: Set up Node for testing |
| 96 | + uses: actions/setup-node@v4 |
| 97 | + with: |
| 98 | + node-version: 22.x |
| 99 | + |
| 100 | + - name: Setup Terraform |
| 101 | + uses: hashicorp/setup-terraform@v2 |
| 102 | + with: |
| 103 | + terraform_version: 1.12.2 |
| 104 | + |
| 105 | + - uses: actions/checkout@v4 |
| 106 | + env: |
| 107 | + HUSKY: "0" |
| 108 | + - uses: aws-actions/setup-sam@v2 |
| 109 | + with: |
| 110 | + use-installer: true |
| 111 | + - name: Set up Python 3.11 |
| 112 | + uses: actions/setup-python@v5 |
| 113 | + with: |
| 114 | + python-version: 3.11 |
| 115 | + - name: Download Build files |
| 116 | + uses: actions/download-artifact@v4 |
| 117 | + with: |
| 118 | + name: build-prod |
| 119 | + - uses: aws-actions/configure-aws-credentials@v4 |
| 120 | + with: |
| 121 | + role-to-assume: arn:aws:iam::298118738376:role/GitHubActionsRole |
| 122 | + role-session-name: Manual_Core_Prod_Deployment_${{ github.run_id }} |
| 123 | + aws-region: us-east-1 |
| 124 | + - name: Publish to AWS |
| 125 | + run: make deploy_prod |
| 126 | + env: |
| 127 | + HUSKY: "0" |
| 128 | + VITE_RUN_ENVIRONMENT: prod |
| 129 | + - name: Call the health check script |
| 130 | + run: make prod_health_check |
0 commit comments