Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:coronasafe/care_fe into abdm-m3
Browse files Browse the repository at this point in the history
  • Loading branch information
khavinshankar committed Jan 20, 2024
2 parents b3d0f5a + f6159eb commit 971d819
Show file tree
Hide file tree
Showing 365 changed files with 19,181 additions and 11,711 deletions.
16 changes: 15 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,21 @@
"plugin:i18next/recommended",
"plugin:tailwindcss/recommended"
],
"overrides": [
{
"files": [
"**/*.mdx"
],
"extends": [
"plugin:react/recommended",
"plugin:mdx/recommended"
],
"rules": {
"react/jsx-no-target-blank": "off",
"i18next/no-literal-string": "off"
}
}
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
Expand Down Expand Up @@ -72,7 +87,6 @@
"*.res",
"*.css",
"*.csv",
"*.stories.mdx",
"Dockerfile"
]
}
8 changes: 1 addition & 7 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
### WHAT
copilot:summary

## Proposed Changes

- Fixes #issue?
- Fixes #issue_number
- Change 1
- Change 2
- More?
Expand All @@ -18,6 +15,3 @@ copilot:summary
- [ ] Prep screenshot or demo video for changelog entry, and attach it to issue.
- [ ] Request for Peer Reviews
- [ ] Completion of QA

### HOW
copilot:walkthrough
17 changes: 11 additions & 6 deletions .github/workflows/cypress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
fail-fast: false
matrix:
containers: [1,2,3,4,5,6,7,8]
containers: [1, 2, 3, 4, 5, 6, 7, 8]
steps:
- name: Checkout 📥
uses: actions/checkout@v3
Expand All @@ -32,9 +32,9 @@ jobs:
run: |
cd care
make docker_config_file=docker-compose.pre-built.yaml up
while docker compose exec backend bash -c "python manage.py showmigrations 2>/dev/null | cat | grep -q '\[ \]'"; do
while docker compose exec celery-beat bash -c "python manage.py showmigrations 2>/dev/null | cat | grep -q '\[ \]'"; do
>&2 echo "Migrations are not yet applied - sleeping"
sleep 5
sleep 10
done
echo "Migrations are applied"
cd ..
Expand All @@ -43,10 +43,16 @@ jobs:
run: |
cd care
docker compose exec backend bash -c "python manage.py load_dummy_data"
docker restart care-backend-1
cd ..
- name: Check care is up ♻
run: curl -o /dev/null -s -w "%{http_code}\n" http://localhost:9000
- name: Wait for care to be up ♻
uses: nick-fields/retry@v2
with:
timeout_minutes: 1
max_attempts: 5
command: curl -o /dev/null -s -w "%{http_code}\n" http://localhost:9000
on_retry_command: sleep 5

- name: Install dependencies 📦
run: npm install
Expand Down Expand Up @@ -79,4 +85,3 @@ jobs:
with:
name: cypress-screenshots
path: cypress/screenshots

132 changes: 124 additions & 8 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ on:
- master
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
IMAGE_NAME: care_fe
AWS_DEFAULT_REGION: ap-south-1
Expand All @@ -31,7 +35,7 @@ jobs:
uses: docker/setup-buildx-action@v2

- name: Cache Docker layers
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ hashFiles('package-lock.json', 'Dockerfile') }}
Expand Down Expand Up @@ -83,7 +87,7 @@ jobs:
uses: docker/setup-buildx-action@v2

- name: Cache Docker layers
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ hashFiles('package-lock.json', 'Dockerfile') }}
Expand Down Expand Up @@ -145,7 +149,7 @@ jobs:
uses: docker/setup-buildx-action@v2

- name: Cache Docker layers
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ hashFiles('package-lock.json', 'Dockerfile') }}
Expand Down Expand Up @@ -180,6 +184,52 @@ jobs:
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
deploy-staging-gcp:
needs: build-staging
name: Deploy to staging GCP cluster
runs-on: ubuntu-latest
environment:
name: Staging-GCP
url: https://care-staging.ohc.network/
steps:
- name: Checkout Kube Config
uses: actions/checkout@v3
with:
repository: coronasafe/care-staging-gcp
token: ${{ secrets.GIT_ACCESS_TOKEN }}
path: kube
ref: main

- uses: actions/setup-node@v3
with:
node-version: '20'

# Setup gcloud CLI
- uses: google-github-actions/setup-gcloud@94337306dda8180d967a56932ceb4ddcf01edae7
with:
service_account_key: ${{ secrets.GKE_SA_KEY }}
project_id: ${{ secrets.GKE_PROJECT }}

# Get the GKE credentials so we can deploy to the cluster
- uses: google-github-actions/get-gke-credentials@fb08709ba27618c31c09e014e1d8364b02e5042e
with:
cluster_name: ${{ secrets.GKE_CLUSTER }}
location: ${{ secrets.GKE_ZONE }}
credentials: ${{ secrets.GKE_SA_KEY }}

- name: install kubectl
uses: azure/setup-kubectl@v3
with:
version: "v1.23.6"
id: install

- name: Deploy Care Fe Production
run: |
mkdir -p $HOME/.kube/
cd kube/deployments/
sed -i -e "s/_BUILD_NUMBER_/${GITHUB_RUN_NUMBER}/g" care-fe.yaml
kubectl apply -f care-fe.yaml
deploy-production-manipur:
needs: build-production
name: Deploy to GKE Manipur
Expand All @@ -196,6 +246,10 @@ jobs:
path: kube
ref: main

- uses: actions/setup-node@v3
with:
node-version: '20'

# Setup gcloud CLI
- uses: google-github-actions/setup-gcloud@94337306dda8180d967a56932ceb4ddcf01edae7
with:
Expand All @@ -210,7 +264,7 @@ jobs:
credentials: ${{ secrets.GKE_SA_KEY }}

- name: install kubectl
uses: azure/setup-kubectl@v3.0
uses: azure/setup-kubectl@v3
with:
version: "v1.23.6"
id: install
Expand Down Expand Up @@ -238,6 +292,10 @@ jobs:
path: kube
ref: main

- uses: actions/setup-node@v3
with:
node-version: '20'

# Setup gcloud CLI
- uses: google-github-actions/setup-gcloud@94337306dda8180d967a56932ceb4ddcf01edae7
with:
Expand All @@ -252,7 +310,7 @@ jobs:
credentials: ${{ secrets.GKE_SA_KEY }}

- name: install kubectl
uses: azure/setup-kubectl@v3.0
uses: azure/setup-kubectl@v3
with:
version: "v1.23.6"
id: install
Expand Down Expand Up @@ -280,6 +338,10 @@ jobs:
path: kube
ref: main

- uses: actions/setup-node@v3
with:
node-version: '20'

# Setup gcloud CLI
- uses: google-github-actions/setup-gcloud@94337306dda8180d967a56932ceb4ddcf01edae7
with:
Expand All @@ -294,7 +356,7 @@ jobs:
credentials: ${{ secrets.GKE_SA_KEY }}

- name: install kubectl
uses: azure/setup-kubectl@v3.0
uses: azure/setup-kubectl@v3
with:
version: "v1.23.6"
id: install
Expand Down Expand Up @@ -322,6 +384,10 @@ jobs:
path: kube
ref: main

- uses: actions/setup-node@v3
with:
node-version: '20'

# Setup gcloud CLI
- uses: google-github-actions/setup-gcloud@94337306dda8180d967a56932ceb4ddcf01edae7
with:
Expand All @@ -336,7 +402,7 @@ jobs:
credentials: ${{ secrets.GKE_SA_KEY }}

- name: install kubectl
uses: azure/setup-kubectl@v3.0
uses: azure/setup-kubectl@v3
with:
version: "v1.23.6"
id: install
Expand All @@ -363,6 +429,56 @@ jobs:
token: ${{ secrets.GIT_ACCESS_TOKEN }}
path: kube
ref: main

- uses: actions/setup-node@v3
with:
node-version: '20'

# Setup gcloud CLI
- uses: google-github-actions/setup-gcloud@94337306dda8180d967a56932ceb4ddcf01edae7
with:
service_account_key: ${{ secrets.GKE_SA_KEY }}
project_id: ${{ secrets.GKE_PROJECT }}

# Get the GKE credentials, so we can deploy to the cluster
- uses: google-github-actions/get-gke-credentials@fb08709ba27618c31c09e014e1d8364b02e5042e
with:
cluster_name: ${{ secrets.GKE_CLUSTER }}
location: ${{ secrets.GKE_ZONE }}
credentials: ${{ secrets.GKE_SA_KEY }}

- name: install kubectl
uses: azure/setup-kubectl@v3
with:
version: "v1.23.6"
id: install

- name: Deploy Care Fe Production
run: |
mkdir -p $HOME/.kube/
cd kube/deployments/
sed -i -e "s/_BUILD_NUMBER_/${GITHUB_RUN_NUMBER}/g" care-fe.yaml
kubectl apply -f care-fe.yaml
deploy-production-meghalaya:
needs: build-production
name: Deploy to GKE Meghalaya
runs-on: ubuntu-latest
environment:
name: Production-Meghalaya
url: https://care.meghealth.gov.in
steps:
- name: Checkout Kube Config
uses: actions/checkout@v3
with:
repository: coronasafe/ml-care-infra
token: ${{ secrets.GIT_ACCESS_TOKEN }}
path: kube
ref: main

- uses: actions/setup-node@v3
with:
node-version: '20'

# Setup gcloud CLI
- uses: google-github-actions/setup-gcloud@94337306dda8180d967a56932ceb4ddcf01edae7
Expand All @@ -378,7 +494,7 @@ jobs:
credentials: ${{ secrets.GKE_SA_KEY }}

- name: install kubectl
uses: azure/setup-kubectl@v3.0
uses: azure/setup-kubectl@v3
with:
version: "v1.23.6"
id: install
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Lint Code Base

on:
pull_request:
branches:
- develop
- master
merge_group:

jobs:
lint:
runs-on: ubuntu-latest
permissions:
contents: read
packages: read
statuses: write

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install dependencies
run: npm ci

- name: Run lint
run: npm run lint -- --quiet
4 changes: 2 additions & 2 deletions .github/workflows/ossar-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
steps:
# Checkout your code repository to scan
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
Expand All @@ -30,7 +30,7 @@ jobs:

# Run open source static analysis tools
- name: Run OSSAR
uses: github/ossar-action@v1
uses: github/ossar-action@fae13e456b9973657a670eef6bccc3a4c2b5153d
id: ossar

# Upload results to the Security tab
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/thank-you.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Say thanks for the contributors

on:
pull_request:
pull_request_target:
types:
- closed

Expand Down
Loading

0 comments on commit 971d819

Please sign in to comment.