-
Notifications
You must be signed in to change notification settings - Fork 296
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9a69de4
commit 78fad78
Showing
48 changed files
with
531 additions
and
215 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,30 @@ | ||
# start with official ruby docker image as base | ||
FROM ruby:3.1.2 | ||
|
||
# set working directory within container | ||
WORKDIR /usr/src/app | ||
|
||
# pull in ruby (jekyll) and python (cite process) package info | ||
COPY Gemfile Gemfile.lock _cite/requirements.txt ./ | ||
|
||
# install ruby packages | ||
RUN VERSION=$(grep -A 1 'BUNDLED WITH' Gemfile.lock | tail -n 1 | xargs); \ | ||
gem install bundler --version ${VERSION} && \ | ||
bundle _${VERSION}_ install | ||
|
||
# install python | ||
RUN apt update && apt install -y python3 python3-pip | ||
|
||
# install python packages | ||
RUN python3 -m pip install --upgrade --requirement requirements.txt | ||
|
||
# install python package for listening for file changes | ||
RUN pip install "watchdog[watchmedo]" | ||
|
||
# ports used by jekyll | ||
EXPOSE 4000 | ||
EXPOSE 35729 | ||
|
||
# run jekyll and cite process | ||
COPY .docker/entrypoint.sh /var | ||
CMD [ "/var/entrypoint.sh" ] |
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,24 @@ | ||
#! /bin/bash | ||
|
||
# print folder contents for debugging | ||
echo "Contents:" | ||
echo "" | ||
ls | ||
echo "" | ||
|
||
# run jekyll serve in hot-reload mode. | ||
# rerun whenever _config.yaml changes (jekyll hot-reload doesn't work with this file). | ||
watchmedo auto-restart \ | ||
--debug-force-polling \ | ||
--patterns="_config.yaml" \ | ||
--signal SIGTERM \ | ||
-- bundle exec jekyll serve --open-url --force_polling --livereload --trace --host=0.0.0.0 \ | ||
| sed 's/0.0.0.0/localhost/g' & | ||
|
||
# run cite process. | ||
# rerun whenever _data files change. | ||
watchmedo shell-command \ | ||
--debug-force-polling \ | ||
--recursive \ | ||
--command="python3 _cite/cite.py" \ | ||
--patterns="_data/sources*;_data/orcid*;_data/pubmed*;_data/google-scholar*" \ |
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,37 @@ | ||
#! /bin/bash | ||
|
||
# name of image | ||
IMAGE=lab-website-renderer:latest | ||
|
||
# name of running container | ||
CONTAINER=lab-website-renderer | ||
|
||
# choose platform flag | ||
PLATFORM="" | ||
|
||
# default vars | ||
DOCKER_RUN="docker run" | ||
WORKING_DIR=$(pwd) | ||
|
||
# fix windows faux linux shells/tools | ||
if [[ $OSTYPE == msys* ]] || [[ $OSTYPE == cygwin* ]]; then | ||
DOCKER_RUN="winpty docker run" | ||
WORKING_DIR=$(cmd //c cd) | ||
fi | ||
|
||
# build docker image | ||
docker build ${PLATFORM} \ | ||
--tag ${IMAGE} \ | ||
--file ./.docker/Dockerfile . && \ | ||
|
||
# run built docker image | ||
${DOCKER_RUN} ${PLATFORM} \ | ||
--name ${CONTAINER} \ | ||
--init \ | ||
--rm \ | ||
--interactive \ | ||
--tty \ | ||
--publish 4000:4000 \ | ||
--publish 35729:35729 \ | ||
--volume "${WORKING_DIR}:/usr/src/app" \ | ||
${IMAGE} "$@" |
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
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
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
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 |
---|---|---|
|
@@ -57,7 +57,7 @@ jobs: | |
.split(/^##?#?#?/m) | ||
.map((section) => { | ||
const [heading, ...body] = section.split("\n"); | ||
return [heading.trim(), body.join("\n").trim()]; | ||
return { heading, body: body.join("\n") }; | ||
}); | ||
// check version | ||
|
@@ -71,8 +71,8 @@ jobs: | |
// check changelog | ||
const newSection = changelog.find( | ||
([heading, body]) => | ||
heading.includes(newVersion) && heading.includes(newDate) && body | ||
({ heading, body }) => | ||
heading.includes(newVersion) && heading.includes(newDate) && body.trim() | ||
); | ||
if (!newSection) throw Error("Changelog not updated or not valid"); | ||
|
@@ -109,27 +109,21 @@ jobs: | |
.split(/^##?#?#?/m) | ||
.map((section) => { | ||
const [heading, ...body] = section.split("\n"); | ||
return [heading.trim(), body.join("\n").trim()]; | ||
return { heading, body: body.join("\n") }; | ||
}); | ||
// find changelog body for version | ||
const body = | ||
changelog.find( | ||
([heading]) => heading.includes(version) && heading.includes(date) | ||
({ heading }) => heading.includes(version) && heading.includes(date) | ||
)?.body || ""; | ||
return { version, body }; | ||
- name: Create a tag | ||
id: tag | ||
uses: mathieudutour/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
custom_tag: ${{ fromJson(steps.version.outputs.result).version }} | ||
|
||
- name: Create a GitHub release | ||
- name: Create tag and GitHub release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
tag: ${{ fromJson(steps.version.outputs.result).version }} | ||
name: ${{ fromJson(steps.version.outputs.result).version }} | ||
commit: ${{ github.ref }} | ||
tag: v${{ fromJson(steps.version.outputs.result).version }} | ||
name: v${{ fromJson(steps.version.outputs.result).version }} | ||
body: ${{ fromJson(steps.version.outputs.result).body }} |
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
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
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
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
Binary file not shown.
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
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
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
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
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,10 @@ | ||
{% assign color = site.data.types[include.type].color | default: "#808080" %} | ||
<div class="alert" style="--color: {{ color }}"> | ||
{% assign icon = site.data.types[include.type].icon | ||
| default: "fa-solid fa-circle-info" | ||
%} | ||
{% include icon.html icon=icon %} | ||
<div class="alert-content"> | ||
{{ include.content | markdownify }} | ||
</div> | ||
</div> |
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
Oops, something went wrong.