-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path.gitlab-ci.yml
68 lines (58 loc) · 1.47 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
58
59
60
61
62
63
64
65
66
67
68
include:
- template: Jobs/SAST.latest.gitlab-ci.yml
- template: Jobs/Secret-Detection.latest.gitlab-ci.yml
##
## TESTS
##
sast:
needs: []
secret_detection:
needs: []
##
## GITLAB PAGES SETUP
##
pages:
needs: []
image: jekyll/jekyll
stage: deploy
environment:
name: production
url: https://${CI_PROJECT_ROOT_NAMESPACE}.gitlab.io/docs-team/governance-proposals/
action: start
variables:
GIT_DEPTH: 0
BASEURL: /docs-team/governance-proposals/
cache:
key:
files:
- requirements.txt
paths:
- .jekyll-cache
before_script:
- if [ -d "public" ]; then echo "Directory ./public exists while it should not as it is used for docs artifacts" && exit 1; fi
- apk add yq
- |
yq eval -i '.url = strenv(CI_ENVIRONMENT_URL)' _config.yml
yq eval -i '.baseurl = strenv(BASEURL)' _config.yml
- cat _config.yml
script:
- jekyll build
artifacts:
expire_in: 30 days
paths:
- public
rules:
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
jekyll-preview:
extends: pages
stage: build
environment:
name: review/$CI_COMMIT_REF_SLUG
url: https://${CI_PROJECT_ROOT_NAMESPACE}.gitlab.io/-/docs-team/governance-proposals/-/jobs/$CI_JOB_ID/artifacts/public/index.html
variables:
BASEURL: /-/docs-team/governance-proposals/-/jobs/$CI_JOB_ID/artifacts/public/
rules:
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
when: never
- if: $CI_MERGE_REQUEST_IID == null
- if: $CI_MERGE_REQUEST_IID != null