fix: 精简 deploy.yml,checkout + ref + verify 三步确保拉取正确分支 #146

Merged
huanghaosheng merged 2 commits from fix/actions into develop 2026-06-20 17:50:08 +08:00
Showing only changes of commit 92e6636d05 - Show all commits

View File

@@ -10,19 +10,17 @@ jobs:
steps:
- name: Checkout
uses: "http://8.161.227.145:3000/huanghaosheng/checkout@releases/v4"
with:
ref: ${{ github.ref }}
- name: Verify checkout
run: |
echo "触发分支: ${GITHUB_REF_NAME}"
echo "当前 HEAD: $(git log -1 --oneline)"
- name: Install Docker CLI
run: apk add --no-cache docker-cli docker-cli-compose rsync
- name: Switch to trigger branch
run: |
git config --global --add safe.directory "$(pwd)"
echo "触发分支: ${GITHUB_REF_NAME}"
git fetch origin "${GITHUB_REF_NAME}" --depth=1
git checkout "${GITHUB_REF_NAME}"
git reset --hard "origin/${GITHUB_REF_NAME}"
echo "当前提交: $(git log -1 --oneline)"
- name: Sync to deploy directory
run: |
mkdir -p /root/camtalk