Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 85 additions & 4 deletions .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
- 'v*'

jobs:
test:
test-unit:
permissions:
contents: read
runs-on: ubuntu-latest
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
id: get_version
run: echo "VITE_BUILD_HASH=${GITHUB_REF#refs/tags/v}" >> "$GITHUB_ENV"

- name: Run build
- name: Run Prod build
run: make build
env:
HUSKY: "0"
Expand All @@ -88,6 +88,87 @@ jobs:
dist/
dist_ui/

- name: Clean and run QA build
run: rm -rf dist/ && rm -rf dist_ui/ && make build
env:
HUSKY: "0"
VITE_RUN_ENVIRONMENT: qa
RunEnvironment: qa

- name: Upload Build files
uses: actions/upload-artifact@v4
with:
include-hidden-files: true
name: build-qa
path: |
.aws-sam/
dist/
dist_ui/

test-e2e:
runs-on: ubuntu-latest
timeout-minutes: 30
name: Run E2E testing
concurrency:
group: ${{ github.event.repository.name }}-dev-env
cancel-in-progress: false
permissions:
id-token: write
contents: read
needs:
- build
environment: "AWS QA"
steps:
- uses: actions/checkout@v5
env:
HUSKY: "0"

- name: Set up Node for testing
uses: actions/setup-node@v5
with:
node-version: 22.x
cache: "yarn"

- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: 1.12.2

- name: Restore Yarn Cache
uses: actions/cache@v4
with:
path: node_modules
key: yarn-modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-dev
restore-keys: |
yarn-modules-${{ runner.arch }}-${{ runner.os }}-

- name: Download Build files
uses: actions/download-artifact@v5
with:
name: build-qa

- uses: aws-actions/configure-aws-credentials@v5
with:
role-to-assume: arn:aws:iam::427040638965:role/GitHubActionsRole
role-session-name: Core_QA_Deployment_${{ github.run_id }}
aws-region: us-east-2

- name: Publish to AWS
run: make deploy_qa
env:
HUSKY: "0"
VITE_RUN_ENVIRONMENT: dev

- name: Run health check
run: make dev_health_check

- name: Run E2E testing
run: make test_e2e
env:
JWT_KEY: ${{ secrets.JWT_KEY }}
PLAYWRIGHT_USERNAME: ${{ secrets.PLAYWRIGHT_USERNAME }}
PLAYWRIGHT_PASSWORD: ${{ secrets.PLAYWRIGHT_PASSWORD }}

deploy-prod:
runs-on: ubuntu-latest
timeout-minutes: 30
Expand All @@ -99,8 +180,8 @@ jobs:
id-token: write
contents: read
needs:
- test
- build
- test-unit
- test-e2e
environment: "AWS PROD"
steps:
- name: Set up Node for testing
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/deploy-qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ jobs:
with:
name: build


- uses: aws-actions/configure-aws-credentials@v5
with:
role-to-assume: arn:aws:iam::427040638965:role/GitHubActionsRole
Expand All @@ -143,9 +142,7 @@ jobs:
- name: Run health check
run: make dev_health_check

- name: Run post-deploy testing (Live and E2E)
run: make test_post_deploy -j 2
- name: Run live integration testing
run: make test_live_integration
env:
PLAYWRIGHT_USERNAME: ${{ secrets.PLAYWRIGHT_USERNAME }}
PLAYWRIGHT_PASSWORD: ${{ secrets.PLAYWRIGHT_PASSWORD }}
JWT_KEY: ${{ secrets.JWT_KEY }}
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ test_e2e: install
yarn playwright install
yarn test:e2e

test_post_deploy: test_live_integration test_e2e

dev_health_check:
curl -f https://core.aws.qa.acmuiuc.org/api/v1/healthz && curl -f https://core.aws.qa.acmuiuc.org/

Expand Down
Loading