Skip to content

Commit

Permalink
Remove deploy jobs from GitHub workflows (#2058)
Browse files Browse the repository at this point in the history
  • Loading branch information
sainak committed Apr 16, 2024
1 parent ee3052f commit babadb3
Showing 1 changed file with 6 additions and 313 deletions.
319 changes: 6 additions & 313 deletions .github/workflows/deployment.yaml
Expand Up @@ -50,7 +50,7 @@ jobs:
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,enable=${{ startsWith(github.event.ref, 'refs/tags/v') }}
type=raw,value=production-latest-${{ github.run_number }}-{{date 'YYYYMMDD'}}-{{sha}},enable=${{ startsWith(github.event.ref, 'refs/tags/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' }}
Expand Down Expand Up @@ -199,316 +199,9 @@ jobs:
name: Staging-GCP
url: https://care-staging-api.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

# 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.0
with:
version: "v1.23.6"
id: install

- name: Deploy Care Production Manipur
run: |
mkdir -p $HOME/.kube/
cd kube/deployments/
sed -i -e "s/_BUILD_NUMBER_/${GITHUB_RUN_NUMBER}/g" care-backend.yaml
sed -i -e "s/_BUILD_NUMBER_/${GITHUB_RUN_NUMBER}/g" care-celery-beat.yaml
sed -i -e "s/_BUILD_NUMBER_/${GITHUB_RUN_NUMBER}/g" care-celery-worker.yaml
kubectl apply -f care-backend.yaml
kubectl apply -f care-celery-beat.yaml
kubectl apply -f care-celery-worker.yaml
deploy-production-manipur:
needs: notify-release
name: Deploy to GKE Manipur
runs-on: ubuntu-latest
environment:
name: Production-Manipur
url: https://careapi.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

# 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.0
with:
version: "v1.23.6"
id: install

- name: Deploy Care Production Manipur
run: |
mkdir -p $HOME/.kube/
cd kube/deployments/
sed -i -e "s/_BUILD_NUMBER_/${GITHUB_RUN_NUMBER}/g" care-backend.yaml
sed -i -e "s/_BUILD_NUMBER_/${GITHUB_RUN_NUMBER}/g" care-celery-beat.yaml
sed -i -e "s/_BUILD_NUMBER_/${GITHUB_RUN_NUMBER}/g" care-celery-worker.yaml
kubectl apply -f care-backend.yaml
kubectl apply -f care-celery-beat.yaml
kubectl apply -f care-celery-worker.yaml
deploy-production-karnataka:
needs: notify-release
name: Deploy to GKE Karnataka
runs-on: ubuntu-latest
environment:
name: Production-Karnataka
url: https://careapi.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

# 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.0
with:
version: "v1.23.6"
id: install

- name: Deploy Care Production Karnataka
run: |
mkdir -p $HOME/.kube/
cd kube/deployments/
sed -i -e "s/_BUILD_NUMBER_/${GITHUB_RUN_NUMBER}/g" care-backend.yaml
sed -i -e "s/_BUILD_NUMBER_/${GITHUB_RUN_NUMBER}/g" care-celery-beat.yaml
sed -i -e "s/_BUILD_NUMBER_/${GITHUB_RUN_NUMBER}/g" care-celery-worker.yaml
kubectl apply -f care-backend.yaml
kubectl apply -f care-celery-beat.yaml
kubectl apply -f care-celery-worker.yaml
deploy-production-assam:
needs: notify-release
name: Deploy to GKE Assam
runs-on: ubuntu-latest
environment:
name: Production-Assam
url: https://careapi.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

# 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.0
with:
version: "v1.23.6"
id: install

- name: Deploy Care Production Assam
run: |
mkdir -p $HOME/.kube/
cd kube/deployments/
sed -i -e "s/_BUILD_NUMBER_/${GITHUB_RUN_NUMBER}/g" care-backend.yaml
sed -i -e "s/_BUILD_NUMBER_/${GITHUB_RUN_NUMBER}/g" care-celery-beat.yaml
sed -i -e "s/_BUILD_NUMBER_/${GITHUB_RUN_NUMBER}/g" care-celery-worker.yaml
kubectl apply -f care-backend.yaml
kubectl apply -f care-celery-beat.yaml
kubectl apply -f care-celery-worker.yaml
deploy-production-sikkim:
needs: notify-release
name: Deploy to GKE Sikkim
runs-on: ubuntu-latest
environment:
name: Production-Sikkim
url: https://careapi.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

# 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.0
with:
version: "v1.23.6"
id: install

- name: Deploy Care Production Sikkim
run: |
mkdir -p $HOME/.kube/
cd kube/deployments/
sed -i -e "s/_BUILD_NUMBER_/${GITHUB_RUN_NUMBER}/g" care-backend.yaml
sed -i -e "s/_BUILD_NUMBER_/${GITHUB_RUN_NUMBER}/g" care-celery-beat.yaml
sed -i -e "s/_BUILD_NUMBER_/${GITHUB_RUN_NUMBER}/g" care-celery-worker.yaml
kubectl apply -f care-backend.yaml
kubectl apply -f care-celery-beat.yaml
kubectl apply -f care-celery-worker.yaml
deploy-production-nagaland:
needs: notify-release
name: Deploy to GKE Nagaland
runs-on: ubuntu-latest
environment:
name: Production - Nagaland
url: https://careapi.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

# 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.0
with:
version: "v1.23.6"
id: install

- name: Deploy Care Production Nagaland
run: |
mkdir -p $HOME/.kube/
cd kube/deployments/
sed -i -e "s/_BUILD_NUMBER_/${GITHUB_RUN_NUMBER}/g" care-backend.yaml
sed -i -e "s/_BUILD_NUMBER_/${GITHUB_RUN_NUMBER}/g" care-celery-beat.yaml
sed -i -e "s/_BUILD_NUMBER_/${GITHUB_RUN_NUMBER}/g" care-celery-worker.yaml
kubectl apply -f care-backend.yaml
kubectl apply -f care-celery-beat.yaml
kubectl apply -f care-celery-worker.yaml
deploy-production-meghalaya:
needs: notify-release
name: Deploy to GKE Meghalaya
runs-on: ubuntu-latest
environment:
name: Production-Meghalaya
url: https://careapi.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

# 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.0
with:
version: "v1.23.6"
id: install

- name: Deploy Care Production Nagaland
- name: Trigger deploy
run: |
mkdir -p $HOME/.kube/
cd kube/deployments/
sed -i -e "s/_BUILD_NUMBER_/${GITHUB_RUN_NUMBER}/g" care-backend.yaml
sed -i -e "s/_BUILD_NUMBER_/${GITHUB_RUN_NUMBER}/g" care-celery-beat.yaml
sed -i -e "s/_BUILD_NUMBER_/${GITHUB_RUN_NUMBER}/g" care-celery-worker.yaml
kubectl apply -f care-backend.yaml
kubectl apply -f care-celery-beat.yaml
kubectl apply -f care-celery-worker.yaml
COMMIT_SHA=${{ github.sha }}
JSON='{ "substitutions": { "care_be_tag":"'"$COMMIT_SHA"'", "care_fe_tag": "", "metabase_tag": "" } }'
curl --location ${{ secrets.STAGING_GCP_DEPLOY_URL }} \
--header 'Content-Type: application/json' --data "$JSON"

0 comments on commit babadb3

Please sign in to comment.