fix: Add Gitea token authentication for git clone
This commit is contained in:
parent
541b531290
commit
af0f8e1f7a
@ -187,9 +187,11 @@ jobs:
|
||||
|
||||
- name: Deploy to CT109
|
||||
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
|
||||
export VERSION="${{ github.sha }}"
|
||||
export GITEA_TOKEN="$GITEA_TOKEN"
|
||||
|
||||
# Use home directory for deployment
|
||||
DEPLOY_DIR="$HOME/littleshop"
|
||||
@ -201,9 +203,9 @@ jobs:
|
||||
|
||||
# Clone or pull latest code
|
||||
if [ ! -d .git ]; then
|
||||
echo "Cloning repository..."
|
||||
echo "Cloning repository with authentication..."
|
||||
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
|
||||
echo "Repository already cloned, pulling latest..."
|
||||
git fetch origin
|
||||
|
||||
Loading…
Reference in New Issue
Block a user