-
Notifications
You must be signed in to change notification settings - Fork 5
/
.gitlab-ci.yml
42 lines (40 loc) · 1.16 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
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-glightbox mkdocs-open-in-new-tab
- 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
- 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-glightbox mkdocs-open-in-new-tab
- 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
- rsync -r -a -v -e ssh --delete /output/ "$RSYNC_USER"@"$TARGET_SERVER":"$PRODUCTION_DIR"
only:
- production