mirror of
https://gitlab.com/vyla-entertainment/status.git
synced 2026-11-16 23:27:36 -05:00
18 lines
492 B
YAML
18 lines
492 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" | 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" |