From 88fd363c1c4bc834a80398ec99f5bd5956c13868 Mon Sep 17 00:00:00 2001 From: xiaoliutral Date: Thu, 19 Jun 2025 02:33:30 +0800 Subject: [PATCH] Create master.yml --- .github/workflows/master.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/master.yml 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 +