line-and-surface/.gitlab-ci.yml

33 lines
632 B
YAML
Raw Normal View History

2021-01-10 12:35:05 +01:00
stages:
- build
- deploy
2021-01-09 21:53:06 +01:00
build site:
image: node:lts
stage: build
script:
- cd app
2021-04-09 20:23:22 +02:00
- npm ci --cache .npm --prefer-offline
2021-01-09 21:53:06 +01:00
- npm run build
2021-04-09 20:23:22 +02:00
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- app/.npm
2021-01-09 21:53:06 +01:00
artifacts:
paths:
2021-01-09 21:56:22 +01:00
- app/dist
2021-01-10 12:35:05 +01:00
deploy site:
image: instrumentisto/rsync-ssh
stage: deploy
2021-04-09 17:49:02 +02:00
only:
refs:
- master
2021-01-10 12:35:05 +01:00
script:
- mkdir ~/.ssh
- echo "$SSH_KNOWN_HOSTS" >> ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- rsync -vr -e "ssh -p ${SSH_PORT}" app/dist/ "${DEPLOY_DEST}"