Skip to content

Commit

Permalink
[#24] feat: update deploy for cd
Browse files Browse the repository at this point in the history
  • Loading branch information
FacerAin committed Dec 6, 2023
1 parent 7d4fcde commit 52e4bff
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,27 @@ jobs:
run: docker buildx build --platform linux/amd64,linux/arm64 -t syw5141/khugpt-agent:${{ steps.vars.outputs.tag }} --push .

deploy:
needs: build
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Set output
id: vars
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}

- name: Deploy on rpi4 server using docker
uses: appleboy/ssh-action@v1.0.0
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
port: ${{ secrets.PORT }}
script: whoami
script: |
cd ~/khugpt-agent-deploy
export KHUGPT_AGENT_IMAGE_TAG=${{ steps.vars.outputs.tag }}
docker-compose pull
docker-compose up --force-recreate --build -d
docker image prune -f
Expand Down

0 comments on commit 52e4bff

Please sign in to comment.