fix: Add Gitea token authentication for git clone
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:35:30 +00:00
parent 541b531290
commit af0f8e1f7a

View File

@ -187,9 +187,11 @@ jobs:
- name: Deploy to CT109 - name: Deploy to CT109
run: | run: |
ssh -i ~/.ssh/deploy_key -p ${{ secrets.CT109_SSH_PORT }} ${{ secrets.CT109_USER }}@${{ secrets.CT109_HOST }} bash -s << 'ENDSSH' export GITEA_TOKEN="${{ secrets.GITEA_TOKEN }}"
ssh -i ~/.ssh/deploy_key -p ${{ secrets.CT109_SSH_PORT }} ${{ secrets.CT109_USER }}@${{ secrets.CT109_HOST }} bash -s << ENDSSH
set -e set -e
export VERSION="${{ github.sha }}" export VERSION="${{ github.sha }}"
export GITEA_TOKEN="$GITEA_TOKEN"
# Use home directory for deployment # Use home directory for deployment
DEPLOY_DIR="$HOME/littleshop" DEPLOY_DIR="$HOME/littleshop"
@ -201,9 +203,9 @@ jobs:
# Clone or pull latest code # Clone or pull latest code
if [ ! -d .git ]; then if [ ! -d .git ]; then
echo "Cloning repository..." echo "Cloning repository with authentication..."
rm -rf * # Clean any existing files rm -rf * # Clean any existing files
git clone https://git.silverlabs.uk/Jamie/littleshop.git . git clone https://oauth2:${GITEA_TOKEN}@git.silverlabs.uk/Jamie/littleshop.git .
else else
echo "Repository already cloned, pulling latest..." echo "Repository already cloned, pulling latest..."
git fetch origin git fetch origin