portfolio/.forgejo/workflows/deploy.yml
Chneemann ed1d2f9bb1
All checks were successful
Deploy Portfolio to VPS / deploy (push) Successful in 26s
ci: fix deployment working directory to httpdocs
2026-07-30 11:52:07 +02:00

33 lines
863 B
YAML

name: Deploy Portfolio to VPS
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Trigger Build & Deploy via SSH
uses: https://github.com/appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.VPS_HOST }}
username: ${{ secrets.VPS_USER }}
key: ${{ secrets.VPS_SSH_KEY }}
port: ${{ secrets.VPS_PORT }}
script_stop: true
script: |
echo "Starting deployment..."
cd /opt/containers/frontend/httpdocs
echo "Pulling latest code..."
git pull origin main
echo "Rebuilding Docker containers..."
docker compose up -d --build
echo "Cleaning up unused Docker images..."
docker image prune -f
echo "Deployment completed successfully."