Skip to content

Commit

Permalink
Update and rename cd-master.yml to cd-prod.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Chengming-Li authored Apr 17, 2024
1 parent 2da9803 commit 9fe3927
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 36 deletions.
36 changes: 0 additions & 36 deletions .github/workflows/cd-master.yml

This file was deleted.

38 changes: 38 additions & 0 deletions .github/workflows/cd-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name:
Deploy to Staging

on:
repository_dispatch:
types: [trigger-workflow]

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build Docker Image
run: docker build -t berkeleytime-backend ./backend/
- name: Tag Docker Image
run: docker tag berkeleytime-backend ${{ secrets.DOCKER_USERNAME }}/berkeleytime-backend:${{ github.sha }}
- name: Push Docker Image
run: docker push ${{ secrets.DOCKER_USERNAME }}/berkeleytime-backend:${{ github.sha }}
- name: executing remote ssh commands using ssh key
uses: appleboy/[email protected]
with:
host: hozer-51.ocf.berkeley.edu
username: root
key: ${{ secrets.SSH_KEY }}
port: 22
script: |
helm install bt-prod-app-${{ github.sha }} ./app --namespace=bt \
--set host=prod.stanfurdtime.com \
--set mongoUri=mongodb://bt-prod-mongo-mongodb.bt.svc.cluster.local:27017/bt \
--set redisUri=redis://bt-prod-redis-master.bt.svc.cluster.local:6379 \
--set nodeEnv=development

0 comments on commit 9fe3927

Please sign in to comment.