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
6 changes: 5 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@ trim_trailing_whitespace = true

[*.md]
max_line_length = off
trim_trailing_whitespace = false
trim_trailing_whitespace = false

[{Makefile,**.mk}]
# Use tabs for indentation (Makefiles require tabs)
indent_style = tab
37 changes: 8 additions & 29 deletions .github/workflows/deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ jobs:
deploy-dev:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.event.repository.name }}-dev-aws
group: ${{ github.event.repository.name }}-dev-env
cancel-in-progress: false
environment: "AWS DEV"
name: Deploy to AWS DEV
name: Deploy to DEV
needs:
- test-unit
steps:
Expand All @@ -53,33 +53,12 @@ jobs:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- run: make deploy_dev
- name: Publish to AWS
run: make deploy_dev
env:
HUSKY: "0"
deploy-cf-pages-dev:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.event.repository.name }}-dev-cf
cancel-in-progress: false
permissions:
contents: read
deployments: write
needs:
- test-unit
name: Deploy to Cloudflare Pages DEV
environment: "Cloudflare Pages"
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node LTS
uses: actions/setup-node@v4
with:
node-version: 20
- name: Build
run: corepack enable && yarn && yarn run build
env:
VITE_RUN_ENVIRONMENT: dev
- name: Publish
- name: Publish to Cloudflare
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
Expand All @@ -88,14 +67,14 @@ jobs:
directory: dist_ui/
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
branch: main
test:

test-dev:
runs-on: ubuntu-latest
name: Run Live Integration Tests
needs:
- deploy-dev
- deploy-cf-pages-dev
concurrency:
group: ${{ github.event.repository.name }}-dev
group: ${{ github.event.repository.name }}-dev-env
cancel-in-progress: false
steps:
- name: Set up Node
Expand Down
77 changes: 19 additions & 58 deletions .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
name: Run Unit Tests
steps:
- name: Set up Node for testing
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20.x
Expand All @@ -27,10 +27,10 @@ jobs:
deploy-dev:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.event.repository.name }}-dev-aws
group: ${{ github.event.repository.name }}-dev
cancel-in-progress: false
environment: "AWS DEV"
name: Deploy to AWS DEV
name: Deploy to DEV
needs:
- test-unit
steps:
Expand All @@ -53,51 +53,31 @@ jobs:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- run: make deploy_dev
- name: Publish to AWS
run: make deploy_dev
env:
HUSKY: "0"
deploy-cf-pages-dev:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.event.repository.name }}-dev-cf
cancel-in-progress: false
permissions:
contents: read
deployments: write
needs:
- test-unit
name: Deploy to Cloudflare Pages DEV
environment: "Cloudflare Pages"
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node LTS
uses: actions/setup-node@v4
with:
node-version: 20
- name: Build
run: corepack enable && yarn && yarn run build
env:
VITE_RUN_ENVIRONMENT: dev
- name: Publish
- name: Publish to Cloudflare
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: management-ui-dev
directory: dist_ui/
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
test:
branch: main

test-dev:
runs-on: ubuntu-latest
name: Run Live Integration Tests
needs:
- deploy-dev
- deploy-cf-pages-dev
concurrency:
group: ${{ github.event.repository.name }}-dev
cancel-in-progress: false
steps:
- name: Set up Node for testing
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20.x
Expand All @@ -110,11 +90,12 @@ jobs:
python-version: 3.11
- name: Run live testing
run: make test_live_integration
deploy-aws-prod:

deploy-prod:
runs-on: ubuntu-latest
name: Deploy to AWS PROD
name: Deploy to Prod
concurrency:
group: ${{ github.event.repository.name }}-prod-aws
group: ${{ github.event.repository.name }}-prod
cancel-in-progress: false
needs:
- test
Expand All @@ -139,33 +120,12 @@ jobs:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- run: make deploy_prod
- name: Publish to AWS
run: make deploy_prod
env:
HUSKY: "0"
deploy-cf-pages-prod:
runs-on: ubuntu-latest
needs:
- test
permissions:
contents: read
deployments: write
concurrency:
group: ${{ github.event.repository.name }}-prod-cf
cancel-in-progress: false
name: Deploy to Cloudflare Pages Prod
environment: "Cloudflare Pages"
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node LTS
uses: actions/setup-node@v4
with:
node-version: 20
- name: Build
run: corepack enable && yarn && yarn run build
env:
VITE_RUN_ENVIRONMENT: prod
- name: Publish
- name: Publish to Cloudflare
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
Expand All @@ -174,11 +134,12 @@ jobs:
directory: dist_ui/
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
branch: main

health-check-prod:
runs-on: ubuntu-latest
name: Confirm services healthy
needs:
- deploy-aws-prod
- deploy-prod
concurrency:
group: ${{ github.event.repository.name }}-prod
cancel-in-progress: false
Expand Down
15 changes: 8 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ region="us-east-1"

# DO NOT CHANGE
common_params = --no-confirm-changeset \
--no-fail-on-empty-changeset \
--capabilities CAPABILITY_IAM CAPABILITY_NAMED_IAM CAPABILITY_AUTO_EXPAND \
--region $(region) \
--stack-name $(application_key) \
--no-fail-on-empty-changeset \
--capabilities CAPABILITY_IAM CAPABILITY_NAMED_IAM CAPABILITY_AUTO_EXPAND \
--region $(region) \
--stack-name $(application_key) \
--tags "project=$(application_key)" "techlead=$(techlead)" \
--s3-prefix $(application_key) \
--resolve-s3
Expand All @@ -45,6 +45,7 @@ clean:
rm -rf src/api/node_modules/
rm -rf src/ui/node_modules/
rm -rf dist/
rm -rf dist_ui/

build: src/ cloudformation/ docs/
yarn -D
Expand All @@ -54,7 +55,7 @@ build: src/ cloudformation/ docs/
local:
yarn run dev

deploy_prod: check_account_prod build
deploy_prod: check_account_prod build
aws sts get-caller-identity --query Account --output text
sam deploy $(common_params) --parameter-overrides $(run_env)=prod $(set_application_prefix)=$(application_key) $(set_application_name)="$(application_name)"

Expand All @@ -74,7 +75,7 @@ test_unit: install_test_deps
yarn test:unit

dev_health_check:
curl -f https://$(application_key).aws.qa.acmuiuc.org/api/v1/healthz
curl -f https://$(application_key).aws.qa.acmuiuc.org/api/v1/healthz && curl -f https://manage.qa.acmuiuc.org

prod_health_check:
curl -f https://$(application_key).aws.acmuiuc.org/api/v1/healthz
curl -f https://$(application_key).aws.acmuiuc.org/api/v1/healthz && curl -f https://manage.acm.illinois.edu
Loading
Loading