Skip to content

Create CsvGenerator.tsx #259

Create CsvGenerator.tsx

Create CsvGenerator.tsx #259

Workflow file for this run

name: dashboard
on:
push:
branches:
- production
pull_request:
branches:
- production
- master
env:
IMAGE_NAME: dashboard
jobs:
test:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v2
- name: Run tests
run: |
if [ -f docker-compose.test.yml ]; then
docker-compose --file docker-compose.test.yml build
docker-compose --file docker-compose.test.yml run sut
else
docker build . --file Dockerfile
fi
build-github-production:
# needs: test
if: github.ref == 'refs/heads/production'
name: Build and push to GitHub
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set current date as ENV variable
run: echo "NOW=$(date +'%Y%m%d')" >> $GITHUB_ENV
- name: Github Short SHA
run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV
- name: Build image
run: docker build . --file Dockerfile --tag $IMAGE_NAME
- name: Log into registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Push image
run: |
IMAGE_ID=ghcr.io/${{ github.repository }}
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
[ "$VERSION" == "master" ] && VERSION=production-latest
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION-$GITHUB_RUN_NUMBER-$NOW-$SHORT_SHA
docker tag $IMAGE_NAME $IMAGE_ID:production-latest
docker push $IMAGE_ID --all-tags
deploy-production-manipur:
needs: build-github-production
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
# 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/[email protected]
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-dashboard.yaml
kubectl apply -f care-dashboard.yaml