From 6c18a17305bdcea32fb510442eb1a7ff0643fbb1 Mon Sep 17 00:00:00 2001 From: alwaysmesmerizingyou Date: Fri, 14 Aug 2026 13:03:55 -0700 Subject: [PATCH] Add GitLab VPS deployment workflow --- .gitlab-ci.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..fec7725 --- /dev/null +++ b/.gitlab-ci.yml @@ -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" \ No newline at end of file