set up CI, likely with many bugs

This commit is contained in:
ashastral 2022-12-21 14:51:05 -08:00
parent fcb696f01c
commit e02825edb1

29
src/.gitlab-ci.yml Normal file
View file

@ -0,0 +1,29 @@
image: node:16
workflow:
rules:
- if: '$CI_COMMIT_BRANCH'
cache:
paths:
- .yarn
deploy:
before_script:
- apt update -yq
# Set up rsync to dev server
- apt install -y rsync
- 'which ssh-agent || ( apt install openssh-client -y )'
- mkdir -p ~/.ssh
- eval $(ssh-agent -s)
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
- ssh-add <(echo "$RSYNC_PRIVATE_KEY")
- echo "$RSYNC_PRIVATE_KEY" > ~/.ssh/id_rsa
# Install yarn & make it accessible
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
script:
- yarn install --cache-folder .yarn
- rsync -avuz -e 'ssh -i ~/.ssh/id_rsa' public/ $RSYNC_DESTINATION
rules:
- if: '$CI_COMMIT_BRANCH == "main"'