From 9628c5d2480d41c3d115810f63b9d48581ddb50f Mon Sep 17 00:00:00 2001 From: Remco <1+remco@noreply.gitlabi@epicnabbo.nl> Date: Sun, 12 Jul 2026 13:42:12 +0200 Subject: [PATCH] Update .gitea/workflows/deploy.yaml --- .gitea/workflows/deploy.yaml | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index 8df13203..28dc44ef 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -1,14 +1,11 @@ name: Local Build and Deploy - on: push: branches: - main - jobs: deploy: runs-on: shell - steps: - name: Run Deploy Scripts Locally run: | @@ -24,23 +21,29 @@ jobs: # Point Git directly to the local Gitea folder path git remote set-url origin /docker/gitea/gitea/git/repositories/remco/epicnext-cms.git/ - # 3. Fetch and update code as root to bypass folder permission blocks + # 3. Fetch and update code git fetch origin --prune git reset --hard origin/main - # Fix ownership: Ensure www-data owns the files for the web server - sudo chown -R www-data:www-data /var/www/atom-nexst/ - - # 4. Configure pnpm to automatically approve build scripts for dependencies + # 4. Configure pnpm and build pnpm config set trusted-dependencies @parcel/watcher,@swc/core,sharp - - # Install dependencies, run migrations, and build the application pnpm install --frozen-lockfile pnpm db:migrate pnpm prisma generate pnpm build - # 5. Restart the application service + # 5. Fix ownership: Ensure files are web-server accessible after building + sudo chown -R www-data:www-data /var/www/atom-nexst/ + + # 6. Restart and verify the application service + echo "Restarting service..." sudo systemctl restart atom-nexst.service + # Wait 2 seconds and check if the service is actually running smoothly + sleep 2 + if ! systemctl is-active --quiet atom-nexst.service; then + echo "ERROR: atom-nexst.service failed to start!" >&2 + exit 1 + fi + echo "--- Deployment successfully completed ---" \ No newline at end of file