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

48 lines
1 KiB
YAML
Raw Permalink 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:
2022-07-26 00:22:16 +02:00
- yarn install --cache-folder .yarn
- yarn build
- rm dist/.gitkeep # Necessary because `/public` is empty at the moment
2021-04-09 20:23:22 +02:00
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
2022-07-26 00:22:16 +02:00
- .yarn
2021-01-09 21:53:06 +01:00
artifacts:
paths:
2021-05-16 21:33:59 +02:00
- dist
2021-01-10 12:35:05 +01:00
2022-07-26 19:15:14 +02:00
deploy dev:
image: instrumentisto/rsync-ssh
stage: deploy
only:
refs:
- develop
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}" dist/ "${DEPLOY_DEST}/dev/"
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 -
2021-05-16 21:33:59 +02:00
- rsync -vr -e "ssh -p ${SSH_PORT}" dist/ "${DEPLOY_DEST}"