-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy path.gitlab-ci.yml
30 lines (28 loc) · 1.18 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
stages:
- build
- deploy
build:
image: node:9.11.1
stage: build
script:
- npm install
- npm run docs:build
artifacts:
paths:
- docs/.vuepress/
deploy:
image: alpine:latest
stage: deploy
before_script:
- apk --update --no-cache add sshpass openssh git
script:
- git clone https://${GITLAB_DEPLOY_USERNAME}:${GITLAB_DEPLOY_PASSWORD}@gitlab.evoforge.org/skills/skills-deploy.git
- TIMESTAMP=`date +%s`
- TMP_DIR="deployDocs_${TIMESTAMP}"
- DEST_PATH="/home/${CI_USERNAME}/$TMP_DIR"
- sshpass -p $CI_PASSWORD ssh -o StrictHostKeyChecking=no -o PreferredAuthentications=password -o PubkeyAuthentication=no $CI_USERNAME@$CI_IP "rm -rf /home/${CI_USERNAME}/deployDocs_* && mkdir -p ${DEST_PATH}"
- sshpass -p $CI_PASSWORD scp -r skills-deploy ${CI_USERNAME}@${CI_IP}:${DEST_PATH}
- sshpass -p $CI_PASSWORD scp -r docs/.vuepress/dist ${CI_USERNAME}@${CI_IP}:${DEST_PATH}/skills-deploy/skills-docs
- sshpass -p $CI_PASSWORD ssh -o StrictHostKeyChecking=no -o PreferredAuthentications=password -o PubkeyAuthentication=no $CI_USERNAME@$CI_IP "cd ${DEST_PATH}/skills-deploy/skills-docs && ./deployDocs.sh"
only:
- master