-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
44 lines (42 loc) · 1.33 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
stages:
- deploy
deploy staging:
stage: deploy
tags:
- docker
image:
name: squidfunk/mkdocs-material
entrypoint: [""]
script:
- apk update && apk add openssh-client rsync
- pip3 install mkdocs-print-site-plugin mkdocs-awesome-pages-plugin mkdocs-glightbox
- mkdir -p ~/.ssh
- echo "$DEPLOY_PRIVATE_KEY" > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
- mkdir /output
- mkdocs build --site-dir /output
- (cd ./cs && mkdocs build --site-dir /output/cs)
- rsync -r -a -v -e ssh --delete /output/ "$RSYNC_USER"@"$TARGET_SERVER":"$STAGING_DIR"
only:
- main
deploy production:
stage: deploy
tags:
- docker
image:
name: squidfunk/mkdocs-material
entrypoint: [""]
script:
- apk update && apk add openssh-client rsync
- pip3 install mkdocs-print-site-plugin mkdocs-awesome-pages-plugin mkdocs-glightbox
- mkdir -p ~/.ssh
- echo "$DEPLOY_PRIVATE_KEY" > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
- mkdir /output
- mkdocs build --site-dir /output
- (cd ./cs && mkdocs build --site-dir /output/cs)
- rsync -r -a -v -e ssh --delete /output/ "$RSYNC_USER"@"$TARGET_SERVER":"$PRODUCTION_DIR"
only:
- production