diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml new file mode 100644 index 0000000..2801b5d --- /dev/null +++ b/.github/workflows/master.yml @@ -0,0 +1,26 @@ +name: CI/CD Pipeline + +on: + push: + branches: + - master # 监视的分支 + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Deploy to Server + uses: appleboy/ssh-action@v0.1.5 + with: + host: ${{ secrets.SSH_HOST }} + username: ${{ secrets.SSH_USERNAME }} + password: ${{ secrets.SSH_PASSWORD }} + script: | + cd /data/portainer/itfx + git pull origin master + docker build -t interfaceforward_api:latest -f src/InterfaceForward.Api/Dockerfile . + docker service update --force --image interfaceforward_api:latest itfx_interfaceforward_api +