-
Notifications
You must be signed in to change notification settings - Fork 3
39 lines (35 loc) · 1.25 KB
/
deploy-monitor.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: deploy-monitor
on:
push:
branches:
- master
paths:
- 'monitor/**'
env:
PROJECT_ID: ${{ secrets.GKE_PROJECT }}
GKE_CLUSTER: karkaushal
GKE_ZONE: us-central1-c
jobs:
build:
runs-on: ubuntu-latest
steps:
# Create docker image and push it to Dockerhub with Credentials
- uses: actions/checkout@v2
- run: cd monitor && docker build -t hetavshah/monitor .
- run : docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
- run : docker push hetavshah/monitor
# Setup google cloud CLI
- uses: google-github-actions/setup-gcloud@94337306dda8180d967a56932ceb4ddcf01edae7
with:
service_account_key: ${{ secrets.GKE_SA_KEY }}
project_id: ${{ secrets.GKE_PROJECT }}
# connect to Our Cluster
- uses: google-github-actions/get-gke-credentials@fb08709ba27618c31c09e014e1d8364b02e5042e
with:
cluster_name: ${{ env.GKE_CLUSTER }}
location: ${{ env.GKE_ZONE }}
credentials: ${{ secrets.GKE_SA_KEY }}
- run: kubectl rollout restart deployment monitor-depl