mirror of
https://gitlab.com/vyla-entertainment/status.git
synced 2026-11-12 21:27:31 -05:00
Add GitLab VPS deployment workflow
This commit is contained in:
18
.gitlab-ci.yml
Normal file
18
.gitlab-ci.yml
Normal 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"
|
||||
Reference in New Issue
Block a user