remove old
All checks were successful
Deploy to Server / deploy (push) Successful in 32s

This commit is contained in:
2026-04-06 23:44:17 +00:00
parent c80bcbcbe8
commit 11730a8ad0

View File

@@ -1,53 +0,0 @@
version: 46
jobs:
- name: Deploy
steps:
- type: CommandStep
name: Deploy
runInContainer: true
image: ubuntu:latest
interpreter:
type: DefaultInterpreter
commands: |
# 1. Install SSH client and IP routing tools
apt-get update && apt-get install -y openssh-client iproute2
# 2. Setup the SSH key from OneDev secrets
mkdir -p ~/.ssh
echo "@secret:DEPLOY_SSH_KEY@" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
echo "StrictHostKeyChecking no" > ~/.ssh/config
# 3. Dynamically find the Host machine's IP address
HOST_IP=$(ip route | awk '/default/ { print $3 }')
echo "==> Detected Host IP: $HOST_IP"
# 4. SSH into the host machine to execute the deployment
ssh adipu@@$HOST_IP << 'EOF'
set -e
echo "==> Navigating to project directory..."
cd ~/LabWise
echo "==> Pulling latest code..."
git pull onedev main
echo "==> Running Test Build..."
docker compose build
echo "==> Build successful! Deploying new containers..."
docker compose up -d
echo "==> Deployment Complete!"
EOF
useTTY: true
condition: SUCCESSFUL
optional: false
triggers:
- type: BranchUpdateTrigger
branches: main
userMatch: anyone
projects: LabWise
retryCondition: never
maxRetries: 3
retryDelay: 30
timeout: 14400