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
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:
@@ -30,13 +30,13 @@ jobs:
|
|||||||
- name: Pull latest code on server
|
- name: Pull latest code on server
|
||||||
env:
|
env:
|
||||||
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
|
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
|
||||||
|
BRANCH: ${{ github.ref_name }}
|
||||||
run: |
|
run: |
|
||||||
ssh "root@$DEPLOY_HOST" "
|
ssh "root@$DEPLOY_HOST" "
|
||||||
BRANCH="${GITHUB_REF##refs/heads/}"
|
|
||||||
cd /root/art-dag/celery
|
cd /root/art-dag/celery
|
||||||
git fetch origin "$BRANCH"
|
git fetch origin $BRANCH
|
||||||
git checkout "$BRANCH"
|
git checkout $BRANCH
|
||||||
git reset --hard "origin/$BRANCH"
|
git reset --hard origin/$BRANCH
|
||||||
"
|
"
|
||||||
|
|
||||||
- name: Build and push image
|
- name: Build and push image
|
||||||
|
|||||||
Reference in New Issue
Block a user