forked from SORSE/sorse.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.yml
83 lines (71 loc) · 1.71 KB
/
config.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
version: 2.1
workflows:
version: 2
# The build workflow will build a preview for the site, intended for PRs
build:
jobs:
- build-site:
filters:
branches:
ignore: gh-pages
- test-site:
filters:
branches:
ignore: gh-pages
build_jekyll: &build_jekyll
name: Jekyll Build
command: |
echo "Building RSE Blog for Preview"
cd ~/repo
# Update baseurl in config
URL=https://${CIRCLE_BUILD_NUM}-267395254-gh.circle-artifacts.com
echo "baseurl: /0/SORSE" >> _config.yml
echo "url: $URL" >> _config.yml
# Build site to download template
bundle exec jekyll build
test_jekyll: &test_jekyll
name: Test the build
command: |
echo "baseurl: ''" >> _config.yml
echo "url: ''" >> _config.yml
bundle exec rake
executors:
jekyll-executor:
docker:
- image: circleci/ruby:2.4.1
working_directory: ~/repo
environment:
- JEKYLL_ENV: production
- NOKOGIRI_USE_SYSTEM_LIBRARIES: true
- BUNDLE_PATH: ~/repo/vendor/bundle
commands:
install:
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies
- rubygems-v1
- run:
name: Bundle Install
command: |
cd ~/repo
bundle check || bundle install
- save_cache:
key: rubygems-v1
paths:
- vendor/bundle
jobs:
build-site:
executor: jekyll-executor
steps:
- install
- run: *build_jekyll
- store_artifacts:
path: ~/repo/_site
destination: SORSE
test-site:
executor: jekyll-executor
steps:
- install
- run: *test_jekyll