fix: Use git credential helper for Gitea authentication
Some checks failed
Build and Deploy LittleShop / Deploy to Production VPS (Manual Only) (push) Has been skipped
Build and Deploy LittleShop / Deploy to Pre-Production (CT109) (push) Failing after 1s

This commit is contained in:
SysAdmin 2025-11-17 13:46:03 +00:00
parent 310f1f63de
commit f4346a799e

View File

@ -200,16 +200,24 @@ jobs:
mkdir -p "\$DEPLOY_DIR"
cd "\$DEPLOY_DIR"
# Configure git credentials
echo "Configuring git credentials..."
git config --global credential.helper store
echo "https://\${GITEA_TOKEN}:x-oauth-basic@git.silverlabs.uk" > ~/.git-credentials
# Clone or pull latest code
if [ ! -d .git ]; then
echo "Cloning repository with authentication..."
rm -rf * # Clean any existing files
git clone https://\${GITEA_TOKEN}@git.silverlabs.uk/Jamie/littleshop.git .
git clone https://git.silverlabs.uk/Jamie/littleshop.git .
else
echo "Repository already cloned, pulling latest..."
git fetch origin
fi
# Clean up credentials
rm -f ~/.git-credentials
echo "Checking out version: \$VERSION"
git checkout \$VERSION || git checkout main