mirror of
https://gitlab.com/vyla-entertainment/status.git
synced 2026-11-09 19:57:25 -05:00
18 lines
512 B
YAML
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" |