From 21ead3e013eae9ce010411e89ea3bd0aac0fd229 Mon Sep 17 00:00:00 2001 From: bishsh Date: Sat, 4 Oct 2025 20:01:35 +0800 Subject: [PATCH] Update main.yml --- .github/workflows/main.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a9523fe..dc2529c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -63,4 +63,19 @@ jobs: git config user.email "${{ github.actor }}@users.noreply.github.com" 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/bishshi/pages.git" master:master + 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 }} + port: ${{ secrets.PORT }} + script: | + cd /opt/www/sites/blog/index/ + git config --global --add safe.directory "$(pwd)" + git fetch --all --depth=1 + git reset --hard origin/page + git pull --depth=1 + echo "✅ 已拉取 page 分支最新内容"