Files
status/.gitlab-ci.yml
2026-08-14 13:35:05 -07:00

18 lines
512 B
YAML

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_B64" | base64 -d > ~/.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 fetch origin main && git reset --hard origin/main && pm2 restart status || pm2 start server.js --name status && pm2 save"