fix: Simplify to use public HTTPS clone (no authentication needed)
This commit is contained in:
parent
1a7fd96486
commit
25ec371961
@ -187,36 +187,10 @@ jobs:
|
|||||||
|
|
||||||
- name: Deploy to CT109
|
- name: Deploy to CT109
|
||||||
run: |
|
run: |
|
||||||
# Copy SSH key to CT109 for git access
|
|
||||||
echo "Setting up git SSH access on CT109..."
|
|
||||||
scp -i ~/.ssh/deploy_key -P ${{ secrets.CT109_SSH_PORT }} ~/.ssh/deploy_key ${{ secrets.CT109_USER }}@${{ secrets.CT109_HOST }}:~/.ssh/git_deploy_key
|
|
||||||
|
|
||||||
ssh -i ~/.ssh/deploy_key -p ${{ secrets.CT109_SSH_PORT }} ${{ secrets.CT109_USER }}@${{ secrets.CT109_HOST }} bash -s << 'ENDSSH'
|
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 }}"
|
||||||
|
|
||||||
# Configure SSH for git
|
|
||||||
chmod 600 ~/.ssh/git_deploy_key
|
|
||||||
eval "$(ssh-agent -s)"
|
|
||||||
ssh-add ~/.ssh/git_deploy_key 2>/dev/null || true
|
|
||||||
|
|
||||||
# Try to determine Gitea SSH port (try common ports)
|
|
||||||
echo "Testing Gitea SSH connectivity..."
|
|
||||||
for port in 22 2222 2223 3000; do
|
|
||||||
if nc -z -w1 git.silverlabs.uk $port 2>/dev/null; then
|
|
||||||
echo "Found SSH service on port $port"
|
|
||||||
GITEA_SSH_PORT=$port
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Default to 22 if not found
|
|
||||||
GITEA_SSH_PORT=${GITEA_SSH_PORT:-22}
|
|
||||||
echo "Using SSH port: $GITEA_SSH_PORT"
|
|
||||||
|
|
||||||
# Add git.silverlabs.uk to known hosts
|
|
||||||
ssh-keyscan -p $GITEA_SSH_PORT git.silverlabs.uk >> ~/.ssh/known_hosts 2>/dev/null || true
|
|
||||||
|
|
||||||
# Use home directory for deployment
|
# Use home directory for deployment
|
||||||
DEPLOY_DIR=~/littleshop
|
DEPLOY_DIR=~/littleshop
|
||||||
echo "Using deployment directory: $DEPLOY_DIR"
|
echo "Using deployment directory: $DEPLOY_DIR"
|
||||||
@ -225,14 +199,14 @@ jobs:
|
|||||||
mkdir -p "$DEPLOY_DIR"
|
mkdir -p "$DEPLOY_DIR"
|
||||||
cd "$DEPLOY_DIR"
|
cd "$DEPLOY_DIR"
|
||||||
|
|
||||||
# Clone or pull latest code via SSH
|
# Clone or pull latest code (public repository, no auth needed)
|
||||||
if [ ! -d .git ]; then
|
if [ ! -d .git ]; then
|
||||||
echo "Cloning repository via SSH..."
|
echo "Cloning repository from public HTTPS..."
|
||||||
rm -rf * # Clean any existing files
|
rm -rf * # Clean any existing files
|
||||||
GIT_SSH_COMMAND="ssh -i ~/.ssh/git_deploy_key -p $GITEA_SSH_PORT" git clone ssh://git@git.silverlabs.uk:$GITEA_SSH_PORT/Jamie/littleshop.git .
|
git clone https://git.silverlabs.uk/Jamie/littleshop.git .
|
||||||
else
|
else
|
||||||
echo "Repository already cloned, pulling latest..."
|
echo "Repository already cloned, pulling latest..."
|
||||||
GIT_SSH_COMMAND="ssh -i ~/.ssh/git_deploy_key -p $GITEA_SSH_PORT" git fetch origin
|
git fetch origin
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Checking out version: $VERSION"
|
echo "Checking out version: $VERSION"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user