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

This commit is contained in:
hhs
2026-06-20 17:49:36 +08:00
parent 12e2d24f37
commit 92e6636d05

View File

@@ -10,19 +10,17 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
uses: "http://8.161.227.145:3000/huanghaosheng/checkout@releases/v4" 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 - name: Install Docker CLI
run: apk add --no-cache docker-cli docker-cli-compose rsync 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 - name: Sync to deploy directory
run: | run: |
mkdir -p /root/camtalk mkdir -p /root/camtalk