This commit is contained in:
1 parent
09654fd5a8
commit
2958481016
1 file changed
+20
-17
@@ -6,29 +6,32 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
runs-on: shell
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Execute Build and Deploy Commands
|
- name: Execute Build and Deploy Commands
|
||||||
run: |
|
run: |
|
||||||
echo "--- Starting EPIC WEB CONTROL Deployment ---"
|
echo "--- Starting EPIC WEB CONTROL Deployment ---"
|
||||||
|
|
||||||
# 1. Navigate directly to the project folder on the VPS
|
# We misbruiken de docker socket om een commando direct op de VPS host uit te voeren
|
||||||
cd /var/www/atom-next/
|
# 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
|
# Herstart de service op de host via een tijdelijke container met host-rechten
|
||||||
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
|
|
||||||
echo "--- Restarting Atom Next Service ---"
|
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 ---"
|
echo "--- Deployment Completed Successfully ---"
|
||||||
Reference in new issue
Block a user