From db05fac06b8b76f189556d9597e5617fbf3561ac Mon Sep 17 00:00:00 2001 From: Chengming-Li <115936688+Chengming-Li@users.noreply.github.com> Date: Fri, 5 Apr 2024 22:56:27 -0700 Subject: [PATCH] Update cd-branch.yml --- .github/workflows/cd-branch.yml | 30 +++++++----------------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/.github/workflows/cd-branch.yml b/.github/workflows/cd-branch.yml index 01a5a3438..516b74851 100644 --- a/.github/workflows/cd-branch.yml +++ b/.github/workflows/cd-branch.yml @@ -10,26 +10,10 @@ jobs: runs-on: ubuntu-latest steps: - - name: SSH into Hozer - uses: appleboy/ssh-action@v1.0.3 - with: - host: hozer-51.ocf.berkeley.edu - username: root - key: ${{ secrets.SSH_KEY }} - script: | - cd /berkeleytime - git checkout ${{ github.event.pull_request.head.sha }} - git pull - docker compose up --build -d - docker tag berkeleytime-backend octoberkeleytime/bt-backend:${{ github.event.pull_request.head.sha }} - docker tag berkeleytime-frontend octoberkeleytime/bt-frontend:${{ github.event.pull_request.head.sha }} - docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} - docker push octoberkeleytime/bt-backend:${{ github.event.pull_request.head.sha }} - docker push octoberkeleytime/bt-frontend:${{ github.event.pull_request.head.sha }} - helm install bt-dev-app ./app --namespace=bt \ - --set host=${{ github.event.pull_request.head.sha }}.stanfurdtime.com \ - --set mongoUri=mongodb://bt-dev-mongo-mongodb.bt.svc.cluster.local:27017/bt \ - --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 }} + - name: Setup SSH Key + uses: webfactory/ssh-agent@v0.9.0 + with: + ssh-private-key: ${{ secrets.SSH_KEY }} + - name: SSH into Hozer + run: | + ssh root@hozer-51.ocf.berkeley.edu "echo 'test'"