forked from USRSE/usrse.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.yml
85 lines (78 loc) · 2.24 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
84
85
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
install: &install
name: install dependencies for build
command: |
$HOME/conda/bin/pip install -r ~/repo/.circleci/requirements.txt
test_jobs: &test_jobs
name: test the jobs metadata
command: |
cd ~/repo/tests
$HOME/conda/bin/python -m unittest test_jobs
install_python_3: &install_python_3
name: install Python 3.5 dependencies
command: |
ls $HOME
if [ ! -d "/home/circleci/conda" ]; then
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
/bin/bash Miniconda3-latest-Linux-x86_64.sh -b -p $HOME/conda
export PATH=$HOME/conda/bin:$PATH
else
echo "Miniconda 3 is already installed, continuing to build."
fi
build_jekyll: &build_jekyll
name: Jekyll Build
command: |
if [ -z "$CIRCLECI_TRIGGER" ]; then
echo "Building RSE Blog for Preview"
cp ~/repo/.circleci/circle_urls.sh ~/repo/circle_urls.sh
cd ~/repo
chmod u+x circle_urls.sh
bash circle_urls.sh
bundle exec jekyll build
else
echo "Nightly build detected, preview not needed."
fi
jobs:
build-site:
docker:
- image: circleci/ruby:2.4.1
working_directory: ~/repo
environment:
- JEKYLL_ENV: production
- NOKOGIRI_USE_SYSTEM_LIBRARIES: true
- BUNDLE_PATH: ~/repo/vendor/bundle
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies
- rubygems-v1
- run: *install_python_3
- run: *install
- save_cache:
paths:
- /home/circleci/conda
key: v1-dependencies
- run:
name: Bundle Install
command: |
cd ~/repo
bundle check || bundle install
- save_cache:
key: rubygems-v1
paths:
- vendor/bundle
- run: *test_jobs
- run: *build_jekyll
- store_artifacts:
path: ~/repo/_site
destination: usrse.github.io