Loading…
Loading documentation...
Automate build, test, and SSH or REST API deployment stages to a Servers Are Up Linux server from GitLab CI/CD.
Deploy tested artifacts from GitLab CI/CD (.gitlab-ci.yml) to an existing Linux server on Servers Are Up using pinned OpenSSH keys or scoped v1 REST API tokens.
Create a Virtual Datacenter first. Enroll a machine in your cloud account or at your site, or choose a currently qualified external region in the VDC. Check the displayed provider, configuration and price before placing an order.
In your GitLab project, open Settings, choose CI/CD, expand Variables, and add protected variables restricted to your main branch:
DEPLOY_HOST — public IPv4 address for your server's port forwardDEPLOY_PORT — forwarded TCP port for SSHDEPLOY_USER — non-root deploy user on the serverSSH_PRIVATE_KEY — Ed25519 private key (store as a File or masked variable)SSH_KNOWN_HOSTS — pinned output of ssh-keyscan -p PORT HOST.gitlab-ci.ymlstages:
- test
- deploy
test_app:
stage: test
image: node:22-alpine
script:
- npm ci
- npm test
deploy_production:
stage: deploy
image: alpine:3.20
rules:
- if: $CI_COMMIT_BRANCH == "main"
before_script:
- apk add --no-cache openssh-client rsync curl
- install -m 700 -d ~/.ssh
- printf '%s
' "$SSH_PRIVATE_KEY" > ~/.ssh/id_ed25519
- chmod 600 ~/.ssh/id_ed25519
- printf '%s
' "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
script:
- rsync -az --delete --exclude .git ./ -e "ssh -p $DEPLOY_PORT -i ~/.ssh/id_ed25519" "$DEPLOY_USER@$DEPLOY_HOST:/srv/app/"
- ssh -p "$DEPLOY_PORT" -i ~/.ssh/id_ed25519 "$DEPLOY_USER@$DEPLOY_HOST" "cd /srv/app && sudo systemctl restart app && curl -fsS http://127.0.0.1:3000/health"
POST /api/v1/instances/{id}/exec with a scoped sau_... token created under Account settings > API keys.SSH_PRIVATE_KEY as Protected so untrusted merge requests from forks cannot read production credentials.Open the workspace to check your machine’s connection and available controls. For automation, consult the REST API or MCP guide. Include the resource and region when you contact support.