fix(ci): use git switch to avoid deploy dir/branch ambiguity
Build and Deploy / build-and-push (push) Successful in 20s
Build and Deploy / build-and-push (push) Successful in 20s
'git checkout deploy' is ambiguous because the repo contains both a deploy/ directory and a deploy remote tracking branch. Switch to 'git switch' which is branch-only and unambiguous. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -66,7 +66,12 @@ jobs:
|
|||||||
git config user.email "ci@gitea.local"
|
git config user.email "ci@gitea.local"
|
||||||
git config user.name "Gitea CI"
|
git config user.name "Gitea CI"
|
||||||
# Switch to the deploy branch, creating it from the current HEAD if absent.
|
# Switch to the deploy branch, creating it from the current HEAD if absent.
|
||||||
git fetch origin deploy 2>/dev/null && git checkout deploy || git checkout -b deploy
|
# Use 'git switch' (branch-only) to avoid ambiguity with the deploy/ directory.
|
||||||
|
if git fetch origin deploy 2>/dev/null; then
|
||||||
|
git switch deploy
|
||||||
|
else
|
||||||
|
git switch -c deploy
|
||||||
|
fi
|
||||||
# Update the pinned image tag.
|
# Update the pinned image tag.
|
||||||
cd deploy
|
cd deploy
|
||||||
kustomize edit set image solitaire-server=${{ env.IMAGE }}:${{ steps.meta.outputs.sha }}
|
kustomize edit set image solitaire-server=${{ env.IMAGE }}:${{ steps.meta.outputs.sha }}
|
||||||
|
|||||||
Reference in New Issue
Block a user