update runner

This commit is contained in:
Puechberty Arthur
2026-06-10 23:44:38 +02:00
parent e8c7ccf340
commit dc321f43dd
5 changed files with 31 additions and 67 deletions
+13 -31
View File
@@ -1,45 +1,27 @@
name: Deploy Production
name: Deploy Docker
on:
push:
branches: [main]
concurrency:
group: production-deploy
cancel-in-progress: true
branches: ["main"]
jobs:
deploy:
runs-on: self-hosted
steps:
- name: Deploy portfolio Production
shell: bash
- name: Deploy on server
run: |
set -euo pipefail
set -e
echo "============================"
echo " Starting deployment"
echo "============================"
echo "Go to app folder"
cd /opt/apps/portfolio
APP_DIR="/srv/apps/portfolio"
echo "Pull latest code"
git pull origin main
cd "$APP_DIR"
echo "Build & restart containers"
docker compose down || true
docker compose build
docker compose up -d
echo "Fetching latest code..."
git fetch origin main
echo "Resetting local state..."
git reset --hard origin/main
echo "Cleaning untracked files (keeping .env)"
git clean -fd -e .env
echo "Pulling/building containers..."
docker compose pull || true
docker compose up -d --build --remove-orphans
echo "Cleaning unused Docker images..."
docker image prune -f
echo "Deployment finished successfully"
echo "Deploy finished"