-
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.
- Loading branch information
1 parent
d980e7e
commit bb46147
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
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,41 @@ | ||
name: | ||
Deploy to Staging | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
|
||
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 Backend Image | ||
run: docker build -t berkeleytime-backend ./backend/ | ||
- name: Tag Backend Image | ||
run: docker tag berkeleytime-backend ${{ secrets.DOCKER_USERNAME }}/berkeleytime-backend:staging | ||
- name: Push Backend Image | ||
run: docker push ${{ secrets.DOCKER_USERNAME }}/berkeleytime-backend:staging | ||
- name: Build Frontend Image | ||
run: docker build -t berkeleytime-frontend ./frontend/ | ||
- name: Tag Frontend Image | ||
run: docker tag berkeleytime-frontend ${{ secrets.DOCKER_USERNAME }}/berkeleytime-frontend:staging | ||
- name: Push Frontend Image | ||
run: docker push ${{ secrets.DOCKER_USERNAME }}/berkeleytime-frontend:staging | ||
- 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: | | ||
kubectl rollout restart deployment bt-staging-app-backend | ||
kubectl rollout restart deployment bt-staging-app-frontend |