Add GitLab VPS deployment workflow

This commit is contained in:
2026-08-14 13:03:55 -07:00
parent 9181f2900c
commit 6c18a17305

18
.gitlab-ci.yml Normal file
View File

@@ -0,0 +1,18 @@
stages:
- deploy
deploy:
stage: deploy
image: alpine:latest
only:
- main
before_script:
- apk add --no-cache openssh-client
- mkdir -p ~/.ssh
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' > ~/.ssh/id_ed25519
- chmod 600 ~/.ssh/id_ed25519
- ssh-keyscan -H "$VPS_HOST" >> ~/.ssh/known_hosts
script:
- ssh "$VPS_USER@$VPS_HOST" "cd /var/www/status && git pull origin main && npm install --production && pm2 restart status || pm2 start server.js --name status"