-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
executable file
·62 lines (58 loc) · 1.25 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
variables:
DEBIAN_FRONTEND: noninteractive
NODE_VERSION: "18"
CONTENTFUL_LOCALE: "fr-FR"
.build: &build
stage: build
image: ruby:3.0
script:
- curl -sL https://deb.nodesource.com/setup_$NODE_VERSION.x | bash -
- apt-get install -y nodejs
- npm ci
- bundle install
- 'echo url: \"$URL\" >> _config.yml'
- 'echo ga: $GA >> _config.yml'
- CONTENTFUL_CONTENT_TYPE_ID="post" OUTPUT_DIR="src/_articles" npm run contentful2md
- CONTENTFUL_CONTENT_TYPE_ID="tag" OUTPUT_DIR="src/_tags" npm run contentful2md
- npm run build
- bundle exec jekyll build -t
cache:
paths:
- node_modules/
key: "build-$CI_COMMIT_REF_NAME"
artifacts:
name: "$CI_PROJECT_NAME-$CI_COMMIT_SHA"
paths:
- build/
# build_preprod:
# <<: *build
# variables:
# URL: $PREPROD_URL
# GA: "false"
# before_script:
# - mv src/_robots.preprod.txt src/robots.txt
build_prod:
<<: *build
variables:
URL: $PROD_URL
GA: "true"
before_script:
- 'true'
only:
- master
pages:
stage: deploy
dependencies:
- build_prod
image: alpine
environment:
name: prod
url: $PROD_URL
script:
- mv build/ public/
artifacts:
paths:
- public/
only:
- master
when: manual