Skip to content

Commit

Permalink
adding circle build for static preview
Browse files Browse the repository at this point in the history
Signed-off-by: vsoch <[email protected]>
  • Loading branch information
vsoch committed Feb 16, 2020
1 parent 5f64073 commit 85e9464
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .circleci/circle_urls.sh
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"
51 changes: 51 additions & 0 deletions .circleci/config.yml
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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This repository contains static files and workflows to generate the US-RSE map.

![assets/img/usrse-map.png](assets/img/usrse-map.png)

## 1. How does it work?
## How does it work?

The map locations are derived from the US-RSE official roster, meaning
that the institutions or companies are exported, and associated
Expand All @@ -15,14 +15,14 @@ The idea behind using a lookup is that (over time) most locations will be repres
and so new members to USRSE will simply use these same locations and we'll update the counts
with the GitHub workflow.

### 2. How do I update the map?
### 1. How do I update the map?

You don't! The automated workflow does. The workflow under [.github/workflows/update-map.yml](.github/workflows/update-map.yml)
handles this for you. To add yourself (if you haven't yet) you can fill out the
institution field under the [join form](https://docs.google.com/forms/d/e/1FAIpQLSdJbPczGHFN8mfMFu_YQym508OzFtOZxfSzr1sOoINxaMmiaw/viewform).


### 3. How do update locations?
### 2. How do update locations?

The [locations lookup](_data/location-lookup.tsv) is what we update with new institutions.
Basically, it's a lookup of institution name (represented in the roster) and matching
Expand Down

0 comments on commit 85e9464

Please sign in to comment.