Skip to content

Commit

Permalink
Change ssh method
Browse files Browse the repository at this point in the history
  • Loading branch information
Chengming-Li authored Mar 25, 2024
1 parent db49184 commit c35fc10
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/cd-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: SSH into Hozer
uses: appleboy/[email protected]
with:
host: hozer-51.ocf.berkeley.edu
username: root
key: ${{ secrets.SSH_KEY }}
script: |
- name: SSH
run: |
mkdir -p ~/.ssh
echo "${{ secrets.SSH_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh -i ~/.ssh/id_rsa [email protected] << EOF
cd /berkeleytime
git checkout ${{ github.event.pull_request.head.sha }}
git pull
Expand All @@ -32,4 +31,5 @@ jobs:
--set redisUri=redis://bt-dev-redis-master.bt.svc.cluster.local:6379 \
--set nodeEnv=development \
--set frontend.image.tag=${{ github.event.pull_request.head.sha }} \
--set backend.image.tag=${{ github.event.pull_request.head.sha }}
--set backend.image.tag=${{ github.event.pull_request.head.sha }}
EOF
16 changes: 8 additions & 8 deletions .github/workflows/cd-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: SSH into Hozer
uses: appleboy/[email protected]
with:
host: hozer-51.ocf.berkeley.edu
username: root
key: ${{ secrets.SSH_KEY }}
script: |
- name: SSH
run: |
mkdir -p ~/.ssh
echo "${{ secrets.SSH_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh -i ~/.ssh/id_rsa [email protected] << EOF
cd /berkeleytime
git checkout master
git pull
Expand All @@ -27,4 +26,5 @@ jobs:
docker push octoberkeleytime/bt-backend:latest
docker push octoberkeleytime/bt-frontend:latest
kubectl rollout restart deployment bt-staging-app-backend
kubectl rollout restart deployment bt-staging-app-frontend
kubectl rollout restart deployment bt-staging-app-frontend
EOF

0 comments on commit c35fc10

Please sign in to comment.