From f8301524f915b4dbe2e3c0d68b2f732edbb9eacb Mon Sep 17 00:00:00 2001 From: Remco <1+remco@noreply.gitlabi@epicnabbo.nl> Date: Sat, 11 Jul 2026 23:48:30 +0200 Subject: [PATCH] Update .gitea/workflows/deploy.yaml --- .gitea/workflows/deploy.yaml | 53 ++++++++++++++---------------------- 1 file changed, 21 insertions(+), 32 deletions(-) diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index d7e46c89..7bdff868 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -1,5 +1,4 @@ name: Remote Build and Deploy - on: push: branches: @@ -8,50 +7,40 @@ on: jobs: deploy: runs-on: ubuntu-latest - steps: - name: Deploying via SSH connection to VPS Host uses: appleboy/ssh-action@v1.0.3 with: - host: "172.20.2.1" + host: ${{ secrets.VPS_HOST }} username: "root" key: ${{ secrets.SSH_PRIVATE_KEY }} port: 22 + # 'set -e' zorgt ervoor dat het script stopt bij elke fout script: | + set -e echo "--- Starting EPIC WEB CONTROL Deployment ---" - - # 1. Navigate to your project directory on the VPS + cd /var/www/atom-nexst/ - - # 2. Synchronize the application files via Git - git fetch origin + + # 1. Veilige update + git fetch origin --prune git reset --hard origin/main - - # --- CLEAN-UP STEP --- - echo "--- Moving or removing specific items ---" - rm -rf /var/www/atom-nexst/directory-name - - # Install missing node_modules based on updated package.json - echo "--- Installing Dependencies ---" + + # 2. Cleanup (met check) + if [ -d "directory-name" ]; then rm -rf directory-name; fi + + # 3. Dependencies en Build (met volledige paden voor zekerheid) + # Vervang /usr/local/bin/ door de locatie van jouw pnpm (check met 'which pnpm') + export PNPM_HOME="/usr/local/bin" pnpm install --frozen-lockfile - - # Load environment variables from .env file for the next steps - export $(grep -v '^#' .env | xargs) - - # 3. Run database migrations natively - echo "--- Running Database Migrations ---" + + # 4. Database en Types pnpm db:migrate - - # Regenerate Prisma Client to update types - echo "--- Generating Prisma Client Types ---" pnpm prisma generate - - # 4. Compile the updated distribution assets - echo "--- Building Application ---" + + # 5. Build en Restart pnpm build - - # 5. Restart the host background service - echo "--- Restarting Atom Nexst Service ---" sudo systemctl restart atom-nexst.service - - echo "--- Deployment Completed Successfully ---" \ No newline at end of file + + echo "--- EPIC WEB CONTROL Deployment Completed Successfully ---" + \ No newline at end of file