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

This commit is contained in:
Simo committed 2026-07-11 23:09:57 +02:00
1 parent 3140cbbbd4
commit f9213beb9c
1 file changed
+37 -40
+37 -40
View File
@@ -11,69 +11,66 @@ concurrency:
jobs: jobs:
deploy: deploy:
runs-on: shell runs-on: ubuntu-latest
timeout-minutes: 30
steps: steps:
- name: Check out pushed commit - name: Deploying via SSH connection to VPS Host
uses: actions/checkout@v4 uses: appleboy/[email protected]
with: with:
fetch-depth: 1 host: "172.20.2.1"
username: "root"
- name: Deploy AtomCMS key: ${{ secrets.SSH_PRIVATE_KEY }}
shell: bash port: 22
run: | timeout: 120s
command_timeout: 25m
script: |
set -Eeuo pipefail set -Eeuo pipefail
readonly APP_DIR="/var/www/atom-nexst" readonly APP_DIR="/var/www/atom-nexst"
readonly SOURCE_DIR="${GITHUB_WORKSPACE}"
echo "--- Starting EPIC WEB CONTROL Deployment ---" echo "--- Starting EPIC WEB CONTROL Deployment ---"
test -n "$SOURCE_DIR" # 1. Navigate safely to the project directory
test -d "$SOURCE_DIR/src"
test -f "$SOURCE_DIR/package.json"
test -f "$SOURCE_DIR/pnpm-lock.yaml"
test -d "$APP_DIR" test -d "$APP_DIR"
test -f "$APP_DIR/.env" test -f "$APP_DIR/.env"
test "$APP_DIR" = "/var/www/atom-nexst"
echo "--- Synchronizing Application Files ---"
sudo rsync -a --delete \
--exclude=".git/" \
--exclude=".env" \
--exclude=".next/" \
--exclude="node_modules/" \
--exclude="storage/" \
--exclude="docs/" \
"$SOURCE_DIR/" "$APP_DIR/"
cd "$APP_DIR" cd "$APP_DIR"
test "$PWD" = "$APP_DIR" test "$PWD" = "$APP_DIR"
echo "--- Preparing pnpm ---" # 2. Synchronize application files
sudo corepack enable echo "--- Synchronizing Git Repository ---"
sudo corepack prepare [email protected] --activate git fetch origin main
git reset --hard FETCH_HEAD
echo "--- Installing Locked Dependencies ---" echo "--- Current Commit ---"
sudo pnpm install --frozen-lockfile --prod=false git rev-parse HEAD
# 3. Install dependencies from the lockfile
echo "--- Installing Dependencies ---"
corepack enable
corepack prepare [email protected] --activate
pnpm install --frozen-lockfile --prod=false
# Do not export .env manually.
# Next.js and the migration script load it themselves.
# 4. Generate Prisma client
echo "--- Generating Prisma Client ---" echo "--- Generating Prisma Client ---"
sudo pnpm prisma:generate pnpm prisma:generate
# 5. Run database migrations
echo "--- Running Database Migrations ---" echo "--- Running Database Migrations ---"
sudo pnpm db:migrate pnpm db:migrate
# 6. Build the application
echo "--- Building Application ---" echo "--- Building Application ---"
sudo rm -rf -- "$APP_DIR/.next" rm -rf -- "$APP_DIR/.next"
sudo pnpm build pnpm build
# 7. Restart and verify service
echo "--- Restarting Atom Nexst Service ---" echo "--- Restarting Atom Nexst Service ---"
sudo systemctl restart atom-nexst.service systemctl restart atom-nexst.service
sudo systemctl is-active --quiet atom-nexst.service systemctl is-active --quiet atom-nexst.service
echo "--- Verifying Deployed Revision ---"
echo "DEPLOYED_COMMIT=${GITHUB_SHA}"
echo "--- Deployment Completed Successfully ---" echo "--- Deployment Completed Successfully ---"