Skip to content

Commit 1af796e

Browse files
committed
Add production deploy
1 parent e817287 commit 1af796e

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Production deploy
2+
on:
3+
workflow_dispatch: # click the button on Github repo!
4+
5+
jobs:
6+
# This workflow contains a single job called "build"
7+
build:
8+
# The type of runner that the job will run on
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
python-version: [3.6]
13+
14+
# Steps represent a sequence of tasks that will be executed as part of the job
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Install dependencies for kubectl
18+
run: |
19+
curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl
20+
chmod +x ./kubectl
21+
sudo mv ./kubectl /usr/local/bin/kubectl
22+
23+
- name: Deploy in production
24+
env:
25+
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
26+
run: |
27+
echo "$GOOGLE_APPLICATION_CREDENTIALS" | base64 --decode > /tmp/config
28+
export GOOGLE_APPLICATION_CREDENTIALS=/tmp/config
29+
export KUBECONFIG=deployments/promhub_kubeconfig
30+
chmod +x deployments/kubernetes/master/deploy.sh
31+
sh ./deployments/kubernetes/master/deploy.sh

deployments/kubernetes/deploy.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
kubectl version --client
3+
kubectl -n promhub get po
4+
kubectl -n promhub delete po -l app=backend
5+
kubectl apply -f deployments/master/backend-deployment.yaml
6+
kubectl -n promhub get po

0 commit comments

Comments
 (0)