-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
39 lines (35 loc) · 1.68 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
#
# how it works:
# 1. temporary directory /tmp/output/ is created/cleaned
# 2. stuff is generated into that clean directory
# 3. if the generation was successful, stuff is rsync into the actual output directory; stuff that has been removed in build is deleted in this process too
variables:
# we do need that, look below
PATH: '/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/tmp/bin/'
before_script:
- 'mkdir -p /tmp/output/' # create the temporary output dir if it does not exist
- 'rm -rf /tmp/output/*' # clear it if it does
# this builds the whole project,
# including the posts that have future dates and posts marked as published: false
tech-jekyll-master:
script:
- 'cd "$CI_PROJECT_DIR"'
- '/usr/local/bin/bundle install --path vendor/bundle --binstubs' # jekyll requirements
- './bin/jekyll build --future --unpublished --destination=/tmp/output/master/' # stuff the dreams are made of
- '/usr/bin/rsync -avz --delete /tmp/output/master/ /output-master/' # rsync the output files to the output directory, deleting files that have been removed
only:
- master
tags:
- master
#
# this is production
tech-jekyll-production:
script:
- 'cd "$CI_PROJECT_DIR"'
- '/usr/local/bin/bundle install --path vendor/bundle --binstubs' # jekyll requirements
- './bin/jekyll build --destination=/tmp/output/' # stuff the dreams are made of
- '/usr/bin/rsync -avz --delete /tmp/output/ /output/' # rsync the output files to the output directory, deleting files that have been removed
only:
- production
tags:
- production