Fix CI: use github.ref_name for branch in SSH command
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 3m10s

GITHUB_REF wasn't available inside the remote SSH session.
Use Gitea's template interpolation instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
giles
2026-02-23 23:31:57 +00:00
parent be263b1398
commit c7466a2fe8

View File

@@ -30,13 +30,13 @@ jobs:
- name: Pull latest code on server
env:
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
BRANCH: ${{ github.ref_name }}
run: |
ssh "root@$DEPLOY_HOST" "
BRANCH="${GITHUB_REF##refs/heads/}"
cd /root/art-dag/celery
git fetch origin "$BRANCH"
git checkout "$BRANCH"
git reset --hard "origin/$BRANCH"
git fetch origin $BRANCH
git checkout $BRANCH
git reset --hard origin/$BRANCH
"
- name: Build and push image