Files
EpicNext-Cms/.gitea/workflows/deploy.yaml
T
remco f719e2cbb7
Local Build and Deploy / deploy (push) Failing after 0s
Update .gitea/workflows/deploy.yaml
2026-07-12 11:28:30 +02:00

43 lines
1.4 KiB
YAML

name: Local Build and Deploy
on:
push:
branches:
- main
jobs:
deploy:
runs-on: shell
steps:
- name: Run Deploy Scripts Locally
run: |
set -e
echo "--- EPIC WEB CONTROL: Starting Auto-Cleanup & Deploy ---"
# 1. Clean up "dead" containers
docker container prune -f || true
# 2. Navigate to your website directory
cd /var/www/atom-nexst/
# Fix ownership to ensure www-data owns the files
sudo chown -R www-data:www-data .git/
# Force Git to read directly from the local Gitea repository directory
sudo -u www-data git remote set-url origin /docker/gitea/gitea/git/repositories/remco/epicnext-cms.git/
# 3. Fetch and update code using the local web user
sudo -u www-data git fetch origin --prune
sudo -u www-data git reset --hard origin/main
# 4. Install dependencies, run migrations, and build the application
/usr/local/bin/pnpm install --frozen-lockfile
/usr/local/bin/pnpm db:migrate
/usr/local/bin/pnpm prisma generate
/usr/local/bin/pnpm build
# 5. Restart the application service
sudo systemctl restart atom-nexst.service
echo "--- Deployment successfully completed ---"