From 5078b13d3116c97f92a484d3445c9ecd806f4276 Mon Sep 17 00:00:00 2001 From: mandalore Date: Fri, 29 May 2026 00:28:03 -0500 Subject: [PATCH] Add GitLab CI/CD pipeline for build and deploy Co-Authored-By: Claude Sonnet 4.6 --- .gitlab-ci.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..10fcd4e --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,34 @@ +stages: + - build + - deploy + +build: + stage: build + image: node:20-alpine + script: + - npm ci + - npm run build + artifacts: + paths: + - dist/ + expire_in: 1 hour + only: + - main + +deploy: + stage: deploy + image: alpine:latest + before_script: + - apk add --no-cache rsync openssh-client + - eval $(ssh-agent -s) + - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - + - mkdir -p ~/.ssh && chmod 700 ~/.ssh + - echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts + - chmod 644 ~/.ssh/known_hosts + script: + - rsync -avz --delete dist/ $DEPLOY_USER@$DEPLOY_HOST:/var/www/domains/gateway-gamers.net/kingmaker/ + only: + - main + environment: + name: production + url: https://kingmaker.gateway-gamers.net