Files
SousChefAI/.gitea/workflows/deploy.yaml
Aditya Pulipaka 36139d08fc
All checks were successful
Deploy to Server / deploy (push) Successful in 28s
fix 2
Co-authored-by: Copilot <copilot@github.com>
2026-04-29 01:41:25 +00:00

43 lines
1.1 KiB
YAML

name: Deploy to Server
on:
push:
branches:
- recipeGen
jobs:
deploy:
runs-on: ubuntu-latest
container:
image: alpine:latest
steps:
- name: Install SSH and Networking Tools
run: apk add --no-cache openssh-client iproute2 git
- name: Configure SSH Key
run: |
mkdir -p ~/.ssh
echo "${{ secrets.DEPLOY_SSH_KEY }}" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
echo "StrictHostKeyChecking no" > ~/.ssh/config
- name: Execute Remote Deployment
run: |
HOST_IP=$(ip route | awk '/default/ { print $3 }')
echo "==> Detected Host IP: $HOST_IP"
ssh adipu@$HOST_IP << 'EOF'
set -e
echo "==> Navigating to project directory..."
cd ~/SousChefAI
echo "==> Pulling latest code..."
git pull origin recipeGen
echo "==> Building and starting container..."
docker compose up -d --build
echo "==> Pruning old images..."
docker image prune -f
echo "==> Deployment Complete!"
EOF