From 1ec4e64303b03b3c0061de234678eea1df5cab86 Mon Sep 17 00:00:00 2001 From: bishsh Date: Tue, 12 Aug 2025 15:14:33 +0800 Subject: [PATCH] Update main.yml --- .github/workflows/main.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 68de42f..ec583a4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -64,3 +64,18 @@ jobs: git add . git commit -m "${{ github.event.head_commit.message }}··[$(date +"%Z %Y-%m-%d %A %H:%M:%S")]" git push --force --quiet "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git" master:page + - name: 服务器执行拉取命令 + uses: appleboy/ssh-action@v1 + with: + host: ${{ secrets.SERVER_IP }} + username: ${{ secrets.USERNAME }} + key: ${{ secrets.KEY }} + passphrase: ${{ secrets.PASSPHRASE }} + port: ${{ secrets.PORT }} + script: | + cd /opt/1panel/www/sites/blog.biss.click/index/ + git config --global --add safe.directory "$(pwd)" + git fetch --all --depth=1 + git reset --hard origin/main + git pull --depth=1 + echo "✅ 已拉取 page 分支最新内容"