Skip to content

Commit

Permalink
[#24] feat: add deploy workflow on github action
Browse files Browse the repository at this point in the history
  • Loading branch information
FacerAin committed Dec 6, 2023
1 parent b6563db commit 7d4fcde
Showing 1 changed file with 24 additions and 7 deletions.
31 changes: 24 additions & 7 deletions .github/workflows/build.yml → .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: build
name: build and deploy
on:
create:
push:
tags:
- v*
workflow_dispatch:
Expand All @@ -10,23 +10,40 @@ jobs:
steps:
# repository checkout
- uses: actions/checkout@v2

- name: Set output
id: vars
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}

- name: Docker Setup QEMU
uses: docker/setup-qemu-action@v1.2.0

- name: Docker Setup Buildx
uses: docker/setup-buildx-action@v1.6.0

- name: Docker Login
uses: docker/login-action@v1.10.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Build Image
working-directory: .
run: docker buildx build --platform linux/amd64,linux/arm64 -t syw5141/khugpt-agent:${{ steps.vars.outputs.tag }} --push .

deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- 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




0 comments on commit 7d4fcde

Please sign in to comment.