-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding circle build for static preview
Signed-off-by: vsoch <[email protected]>
- Loading branch information
Showing
3 changed files
with
58 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
REPO_ID=$(curl https://api.github.com/repos/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME} | jq --raw-output '.id') | ||
echo "Repo ID is ${REPO_ID}" | ||
BASEURL="https://${CIRCLE_BUILD_NUM}-${REPO_ID}-gh.circle-artifacts.com/0/${CIRCLE_PROJECT_REPONAME}" | ||
sed -i "8 s,.*,baseurl: $BASEURL,g" "_config.yml" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
version: 2.1 | ||
|
||
workflows: | ||
version: 2 | ||
|
||
# The build workflow will build a preview for the site, intended for Pull requests | ||
build: | ||
jobs: | ||
- build-site: | ||
filters: | ||
branches: | ||
ignore: gh-pages | ||
|
||
build_jekyll: &build_jekyll | ||
name: Jekyll Build | ||
command: | | ||
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 | ||
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: | ||
name: Bundle Install | ||
command: | | ||
cd ~/repo | ||
bundle check || bundle install | ||
- save_cache: | ||
key: rubygems-v1 | ||
paths: | ||
- vendor/bundle | ||
- run: *build_jekyll | ||
- store_artifacts: | ||
path: ~/repo/_site | ||
destination: usrse-map |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters