-
Notifications
You must be signed in to change notification settings - Fork 9
43 lines (38 loc) · 1.21 KB
/
cd-stage.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
40
41
42
43
name: Deploy to Staging
concurrency: stage
on:
push:
branches: [master, gql]
jobs:
build-push:
name: Build and Push Images
uses: ./.github/workflows/cd.yaml
with:
tag: latest
secrets: inherit
deploy:
name: Deploy with SSH
needs: [build-push]
runs-on: ubuntu-latest
environment: staging
steps:
- name: SSH and Helm Install
uses: appleboy/[email protected]
with:
host: ${{ secrets.SSH_HOST }}
username: root
key: ${{ secrets.SSH_KEY }}
script: |
cd ./infra
if helm status bt-stage-app ; then
kubectl rollout restart deployment bt-stage-app-backend
kubectl rollout restart deployment bt-stage-app-frontend
else
helm install bt-stage-app ./app --namespace=bt \
--set env=stage \
--set frontend.image.tag=latest \
--set backend.image.tag=latest \
--set host=staging.stanfurdtime.com \
--set mongoUri=mongodb://bt-stage-mongo-mongodb.bt.svc.cluster.local:27017/bt \
--set redisUri=redis://bt-stage-redis-master.bt.svc.cluster.local:6379
fi