This commit is contained in:
1 parent
b93a85e2aa
commit
820ca043f8
1 file changed
+24
-3
@@ -1,15 +1,35 @@
|
||||
script: |
|
||||
name: Remote Build and Deploy
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Deploying via SSH to Host
|
||||
uses: appleboy/[email protected]
|
||||
with:
|
||||
host: "5.252.100.130"
|
||||
username: "root"
|
||||
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||
port: 22
|
||||
script: |
|
||||
set -e
|
||||
echo "--- EPIC WEB CONTROL: Starting Auto-Cleanup & Deploy ---"
|
||||
|
||||
# 1. Ruim "dode" containers op
|
||||
docker container prune -f || true
|
||||
|
||||
# 2. Navigeer naar de map
|
||||
cd /var/www/atom-nexst/
|
||||
|
||||
# Dwing Git om de lokale SSH-sleutel van de root-user op de VPS te gebruiken
|
||||
export GIT_SSH_COMMAND="ssh -i /root/.ssh/id_rsa -o StrictHostKeyChecking=no"
|
||||
|
||||
# Mocht je sleutel ergens anders staan (zoals /home/user/.ssh/), pas dan het pad hierboven aan.
|
||||
|
||||
# 3. Deployment stappen
|
||||
git fetch origin --prune
|
||||
git reset --hard origin/main
|
||||
|
||||
@@ -18,6 +38,7 @@ script: |
|
||||
/usr/local/bin/pnpm prisma generate
|
||||
/usr/local/bin/pnpm build
|
||||
|
||||
# 4. Restart service
|
||||
systemctl restart atom-nexst.service
|
||||
|
||||
echo "--- Deployment succesvol voltooid ---"
|
||||
Reference in new issue
Block a user