diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index a0a0ed3..daae89c 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -2,7 +2,6 @@ name: Build and Deploy on: push: - branches: [main] env: REGISTRY: registry.rose-ash.com:5000 @@ -33,9 +32,11 @@ jobs: DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }} run: | ssh "root@$DEPLOY_HOST" " + BRANCH="${GITHUB_REF##refs/heads/}" cd /root/art-dag/celery - git fetch origin main - git reset --hard origin/main + git fetch origin "$BRANCH" + git checkout "$BRANCH" + git reset --hard "origin/$BRANCH" " - name: Build and push image