From 2958481016e493fdcb0f20b762fdb1b0116406a0 Mon Sep 17 00:00:00 2001 From: Remco <1+remco@noreply.gitlabi@epicnabbo.nl> Date: Sat, 11 Jul 2026 21:38:51 +0200 Subject: [PATCH] Update .gitea/workflows/deploy.yaml --- .gitea/workflows/deploy.yaml | 37 +++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index 81943bae..7e2d291c 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -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 ---" \ No newline at end of file