Update .gitea/workflows/deploy.yaml
This commit is contained in:
1 parent
dcb0380bc4
commit
b93a85e2aa
1 file changed
+6
-26
@@ -1,34 +1,15 @@
|
||||
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
|
||||
# Dit zorgt ervoor dat je SSH-sleutel tijdelijk beschikbaar is voor Git commando's op de VPS:
|
||||
ssh-agent: true
|
||||
script: |
|
||||
script: |
|
||||
set -e
|
||||
echo "--- EPIC WEB CONTROL: Starting Auto-Cleanup & Deploy ---"
|
||||
|
||||
# 1. Ruim "dode" containers op (negeer fouten als er al een opruiming bezig is)
|
||||
docker container prune -f || true
|
||||
|
||||
# 2. Navigeer naar de map
|
||||
cd /var/www/atom-nexst/
|
||||
|
||||
# 3. Deployment stappen
|
||||
# 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.
|
||||
|
||||
git fetch origin --prune
|
||||
git reset --hard origin/main
|
||||
|
||||
@@ -37,7 +18,6 @@ jobs:
|
||||
/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