set up CI, likely with many bugs
This commit is contained in:
parent
fcb696f01c
commit
e02825edb1
1 changed files with 29 additions and 0 deletions
29
src/.gitlab-ci.yml
Normal file
29
src/.gitlab-ci.yml
Normal 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"'
|
Loading…
Reference in a new issue