-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path.gitlab-ci.yml
50 lines (42 loc) · 1.41 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
image: docker.lilhermit.co.uk/lilhermit/sphinx-doc:latest
deploy_master:
only:
- master
- gitlab-ci-migration
stage: deploy
script:
# Switching to sparse-checkout
- git config core.sparseCheckout true
- mkdir .git/info
- echo -e "docs\nupdate-docs.sh" > .git/info/sparse-checkout
# This forcing a re-checkout
- git checkout HEAD^
- git checkout $CI_COMMIT_SHA
## Setup the ssh key
- eval $(ssh-agent -s)
- ssh-add <(echo "$DEPLOY_PRIVATE_KEY")
- mkdir -p ~/.ssh
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
# Build and deploy
- ./update-docs.sh
- rsync -rltDEp --delete --chmod=Dg+s,ug+w,o-w,Fo-w,+X * $DEPLOY_USERNAME@$DEPLOY_HOST:$DEPLOY_ROOT_PATH/lilHermit-cakephp-plugins-bootstrap4-master
deploy_production:
only:
- /^[0-9\.]*$/
stage: deploy
script:
# Switching to sparse-checkout
- git config core.sparseCheckout true
- mkdir .git/info
- echo -e "docs\nupdate-docs.sh" > .git/info/sparse-checkout
# This forcing a re-checkout
- git checkout HEAD^
- git checkout $CI_COMMIT_SHA
## Setup the ssh key
- eval $(ssh-agent -s)
- ssh-add <(echo "$DEPLOY_PRIVATE_KEY")
- mkdir -p ~/.ssh
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
# Build and deploy
- ./update-docs.sh
- rsync -rltDEp --delete --chmod=Dg+s,ug+w,o-w,Fo-w,+X * $DEPLOY_USERNAME@$DEPLOY_HOST:$DEPLOY_ROOT_PATH/lilHermit-cakephp-plugins-bootstrap4