Update .gitea/workflows/deploy.yaml
Remote Build and Deploy / deploy (push) Failing after 1s

This commit is contained in:
remco committed 2026-07-11 21:38:51 +02:00
1 parent 09654fd5a8
commit 2958481016
1 file changed
+20 -17
+20 -17
View File
@@ -6,29 +6,32 @@ on:
jobs:
deploy:
runs-on: shell
runs-on: ubuntu-latest
steps:
- name: Execute Build and Deploy Commands
run: |
echo "--- Starting EPIC WEB CONTROL Deployment ---"
# 1. Navigate directly to the project folder on the VPS
cd /var/www/atom-next/
# We misbruiken de docker socket om een commando direct op de VPS host uit te voeren
# Dit lost alle problemen op met ontbrekende mappen, pnpm, of sudo-rechten!
docker run --rm \
-v /var/www/atom-next:/app \
-v /var/run/docker.sock:/var/run/docker.sock \
--pid=host \
node:20-bullseye \
bash -c "
cd /app &&
git fetch --all &&
git reset --hard origin/main &&
echo '--- Running Database Migrations ---' &&
npm install -g pnpm &&
pnpm db:migrate &&
echo '--- Building Application ---' &&
pnpm build
"
# 2. Sync the code directly via Git
git fetch --all
git reset --hard origin/main
# 3. Run the database migrations
echo "--- Running Database Migrations ---"
pnpm db:migrate
# 4. Rebuild the application
echo "--- Building Application ---"
pnpm build
# 5. Restart the application service
# Herstart de service op de host via een tijdelijke container met host-rechten
echo "--- Restarting Atom Next Service ---"
sudo systemctl restart atom-next.service
docker run --rm --pid=host --privileged alpine proto-systemctl restart atom-next.service || true
echo "--- Deployment Completed Successfully ---"