Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
My ready to go GitLab config to deploy an Eleventy website on a VPS using rsync and ssh
stages:
- build
- deploy
eleventy:
stage: build
image: node:lts-buster
cache:
key: "$CI_JOB_NAME"
paths:
- node_modules/
script:
- npm install
- npm run build
artifacts:
paths:
- dist/
only:
- master
rsync:
stage: deploy
image: instrumentisto/rsync-ssh
script:
- mkdir "${HOME}/.ssh"
- echo "${SSH_HOST_KEY}" > "${HOME}/.ssh/known_hosts"
- echo "${SSH_PRIVATE_KEY}" > "${HOME}/.ssh/id_rsa"
- chmod 700 "${HOME}/.ssh/id_rsa"
- rsync -avH dist/* -e ssh ${SSH_USER}@${SSH_HOST}:${WEBROOT_PATH}
only:
- master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.