-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update and rename cd-master.yml to cd-prod.yml
- Loading branch information
1 parent
2da9803
commit 9fe3927
Showing
2 changed files
with
38 additions
and
36 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |