Skip to content

Fixes high cpu usage in medicines tab, pagination not working, incorr… #10872

Fixes high cpu usage in medicines tab, pagination not working, incorr…

Fixes high cpu usage in medicines tab, pagination not working, incorr… #10872

Workflow file for this run

name: Deploy Care Fe
on:
push:
branches:
- develop
- staging
tags:
- v*
pull_request:
branches:
- develop
- staging
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
IMAGE_NAME: care_fe
AWS_DEFAULT_REGION: ap-south-1
AWS_DEFAULT_OUTPUT: json
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID}}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
EKS_CLUSTER_NAME: ${{ secrets.AWS_EKS_CLUSTER_NAME }}
jobs:
test:
if: github.repository == 'coronasafe/care_fe'
runs-on: ubuntu-latest
name: Test
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-test-${{ hashFiles('package-lock.json', 'Dockerfile') }}
restore-keys: |
${{ runner.os }}-buildx-test-
- name: Test build
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
push: false
provenance: false
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new
- name: Run tests
run: |
echo "running tests..."
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
build:
needs: test
if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/staging' || startsWith(github.event.ref, 'refs/tags/v')
name: Build & Push to container registries
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Generate docker tags
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository }}
${{ secrets.DOCKER_HUB_USERNAME }}/${{ github.event.repository.name }}
tags: |
type=raw,value=production-latest,enable=${{ github.ref == 'refs/heads/v*' }}
type=raw,value=production-latest-${{ github.run_number }}-{{date 'YYYYMMDD'}}-{{sha}},enable=${{ github.ref == 'refs/heads/v*' }}
type=raw,value=staging-latest,enable=${{ github.ref == 'refs/heads/staging' }}
type=raw,value=staging-latest-${{ github.run_number }}-{{date 'YYYYMMDD'}}-{{sha}},enable=${{ github.ref == 'refs/heads/staging' }}
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/develop' }}
type=raw,value=latest-${{ github.run_number }},enable=${{ github.ref == 'refs/heads/develop' }}
type=semver,pattern={{version}}
flavor: |
latest=false
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-build-${{ hashFiles('package-lock.json', 'Dockerfile') }}
restore-keys: |
${{ runner.os }}-buildx-build-
- name: Build and push image
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
push: true
provenance: false
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
notify-release:
needs: build
if: startsWith(github.event.ref, 'refs/tags/v')
name: Notify release
runs-on: ubuntu-latest
steps:
- name: Notify release
run: |
echo "Release ${{ github.sha }} is ready to be deployed to production"
deploy-staging-gcp:
needs: build
if: github.ref == 'refs/heads/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: notify-release
name: Deploy to GKE Manipur
runs-on: ubuntu-latest
environment:
name: Production-Manipur
url: https://care.mn.gov.in
steps:
- name: Checkout Kube Config
uses: actions/checkout@v3
with:
repository: coronasafe/mn-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
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-karnataka:
needs: notify-release
name: Deploy to GKE Karnataka
runs-on: ubuntu-latest
environment:
name: Production-Karnataka
url: https://karnataka.care
steps:
- name: Checkout Kube Config
uses: actions/checkout@v3
with:
repository: coronasafe/ka-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
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-sikkim:
needs: notify-release
name: Deploy to GKE Sikkim
runs-on: ubuntu-latest
environment:
name: Production-Sikkim
url: https://care.sikkim.gov.in
steps:
- name: Checkout Kube Config
uses: actions/checkout@v3
with:
repository: coronasafe/sk-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
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-assam:
needs: notify-release
name: Deploy to GKE Assam
runs-on: ubuntu-latest
environment:
name: Production-Assam
url: https://care.assam.gov.in
steps:
- name: Checkout Kube Config
uses: actions/checkout@v3
with:
repository: coronasafe/as-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
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-nagaland:
needs: notify-release
name: Deploy to GKE Nagaland
runs-on: ubuntu-latest
environment:
name: Production - Nagaland
url: https://care.nagaland.gov.in
steps:
- name: Checkout Kube Config
uses: actions/checkout@v3
with:
repository: coronasafe/nl-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
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: notify-release
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
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