-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
57 lines (51 loc) · 1.8 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
51
52
53
54
55
56
57
default:
image: hub.ilearned.eu/i-learned/ci-cd/blog-builder
tags:
- AMD64
stages:
- updateTranslation
- test
- test-deploy
- prod-deploy
updateTranslation:
stage: updateTranslation
allow_failure: true
script:
- rm -rf ./..?* ./.[!.]* ./*
- git clone https://gitlab.ilearned.eu/i-learned/blog/content-fr .
- bash ./updateTranslation.sh
- git add .
- git commit -m "[🧹 Lint] Updated translations"
- git pull
- git push https://CI_CD:$CI_GIT_USER_PASSWD@gitlab.ilearned.eu/i-learned/blog/content-fr.git
rules:
- if: $CI_COMMIT_BRANCH == "master" && $CI_COMMIT_AUTHOR != "Gitlab CI <contact@ilearned.eu>"
test-job:
stage: test
script:
- rm -rf ./..?* ./.[!.]* ./*
- git clone https://gitlab.ilearned.eu/i-learned/blog/theme .
- git clone https://gitlab.ilearned.eu/i-learned/blog/content-fr.git -b $CI_COMMIT_REF_NAME content/
- make build
artifacts:
paths:
- output/
rules:
- if: $CI_COMMIT_AUTHOR != "Gitlab CI <contact@ilearned.eu>"
prod-deploy-job:
stage: prod-deploy
script:
- eval $(ssh-agent -s)
- mkdir -p ~/.ssh
- echo "$SSH_EBANVM01_PRIVATE_KEY" > ~/.ssh/id_ed25519
- chmod 600 ~/.ssh/id_ed25519
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
- rsync -az --delete -e "ssh -i ~/.ssh/id_ed25519" output/ deploy@vm01.eban.eu.org:/var/www/ilearned-blog
rules:
- if: $CI_COMMIT_BRANCH == "master" && $CI_COMMIT_AUTHOR != "Gitlab CI <contact@ilearned.eu>"
test-deploy-job:
stage: test-deploy
script:
- netlify deploy --site $NETLIFY_SITE_ID --auth $NETLIFY_AUTH_TOKEN --dir output
only:
- merge_requests