Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
agahkarakuzu committed Oct 26, 2020
0 parents commit 80ff526
Show file tree
Hide file tree
Showing 36 changed files with 15,452 additions and 0 deletions.
104 changes: 104 additions & 0 deletions .github/workflows/build-pdf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: Build proceeding PDF
on:
push:
branches:
- master

env:
PUB_NAME: ${{ github.event.repository.name }}
jobs:
buildPDF:
runs-on: ubuntu-latest

container:
image: agahkarakuzu/bhproceedings@sha256:bfc1b7f3b714b12e04a6a6ef1f440e9f19997ac1bfecc2187f2476cf47c22ab3

steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Compile PDF
run: |
mkdir -p data
[ -e data/report.json ] && rm data/report.json
[ -e data/ghdetails.json ] && rm data/ghdetails.json
m2j report.md >> data/report.json
cat <<EOF > data/ghdetails.json
{"pub_name" : "${{env.PUB_NAME}}","repo":"$GITHUB_REPOSITORY"}
EOF
pandoc -s -N --template ./latex/brainhack-report-template.tex report.md -o ./latex/brainhack-${{env.PUB_NAME}}.tex
pandoc -s -N --template ./latex/brainhack-html-template.tex report.md -o ./latex/brainhack-${{env.PUB_NAME}}-html.tex
cd latex
pdflatex brainhack-${{env.PUB_NAME}}.tex
bibtex brainhack-${{env.PUB_NAME}}
pdflatex brainhack-${{env.PUB_NAME}}.tex
pdflatex brainhack-${{env.PUB_NAME}}.tex
pandoc brainhack-${{env.PUB_NAME}}-html.tex -f latex -t html -s -o report.html --bibliography ../report.bib
cp report.html ../layouts/partials/report.html
mkdir -p ../static/pdf
cp brainhack-${{env.PUB_NAME}}.pdf ../static/pdf/brainhack-${{env.PUB_NAME}}.pdf
- uses: actions/upload-artifact@v2
with:
name: PDF Report ${{env.PUB_NAME}}
path: static/pdf/brainhack-${{env.PUB_NAME}}.pdf
- uses: actions/upload-artifact@v2
with:
name: HTML Report ${{env.PUB_NAME}}
path: layouts/partials/report.html
- uses: actions/upload-artifact@v2
with:
name: JSON Report ${{env.PUB_NAME}}
path: data/report.json
- uses: actions/upload-artifact@v2
with:
name: JSON GitHub ${{env.PUB_NAME}}
path: data/ghdetails.json
buildHugo:
runs-on: ubuntu-latest
needs: buildPDF
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 0
- uses: actions/download-artifact@master
with:
name: PDF Report ${{env.PUB_NAME}}
path: static/pdf
- uses: actions/download-artifact@master
with:
name: HTML Report ${{env.PUB_NAME}}
path: layouts/partials
- uses: actions/download-artifact@master
with:
name: JSON Report ${{env.PUB_NAME}}
path: data
- uses: actions/download-artifact@master
with:
name: JSON GitHub ${{env.PUB_NAME}}
path: data
- name: Commit files
run: |
rsync -r figures/ static
git config --local user.email "[email protected]"
git config --local user.name "BHBOT"
git add static/pdf/brainhack-${{env.PUB_NAME}}.pdf
git commit -m "[ADD] 🤖 Compiled PDF" -a
ls ./static/pdf
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.PAT_BOT }}
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.71.1'
- name: Build
run: hugo --minify
env:
HUGO_PARAMS_github: ${{github.workspace}}
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.PAT_BOT }}
publish_dir: ./public
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
public
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "themes/business-frontpage"]
path = themes/business-frontpage
url = https://github.com/cowboysmall-tools/hugo-business-frontpage-theme.git
62 changes: 62 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<h2 align="center"> STEP 1 - Get the machinery running ⚙️ </h2>

<h3 align="center"> Fork this repository </h3>

<p align="center"><img src="https://github.com/channelCS/github-buttons/blob/master/2x/github_fork.png"></p>


<h3 align="center"> Enable actions </h3>
<h3 align="center"> ✅</h3>

<p align="center">Go to the <code>Actions</code> tab in your forked repo, and click the green button that says "I understand my actions, go ahead and enable them".</p>


<h3 align="center"> Create a GitHub access token </h3>
<h3 align="center"> 🔑 </h3>

<p align="center">Follow <a href="https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/creating-a-personal-access-token#creating-a-token">these steps</a> and make sure that you check the <b>repo</b>, <b>admin:repo_hook</b> and <b>workflow</b> boxes while creating your access token.</p>


<h3 align="center"> Create an encrypted secret for your repo </h3>
<h3 align="center"> 🕵️‍♀️ </h3>


<p align="center"> Simply follow <a href="https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets#creating-encrypted-secrets-for-a-repository">these steps</a>.</p>

<p align="center"> The name of the secret must be <code>PAT_BOT</code> and the value must be the key you obtained from the previous step. </p>


<h3 align="center"> Push a dummy change to the <code>master</code> </h3>
<h3 align="center"> 📤 </h3>

<p align="center"> It can be anything, such as simply editing this <code>README.md</code> file you are reading at the moment. </p>


<h3 align="center"> What now ? </h3>
<h3 align="center"> 👀 </h3>

<p align="center">After pushing your changes to the <code>master</code> branch, visit the <b>Actions</b> tab of your repository. You should see an action named <b>Build proceeding PDF</b>, which consists of two steps <code>buildPDF</code> and <code>buildHugo</code>.</p>

<p align="center">Soon after a successful action run, your web page will be deployed. You should see <b>Environments</b> section appeared in your repository (on the right column). In the <b>Environments</b> page, click the <code>View Deployment</code> button to visit your report page! At this stage, it should be identical to the <a href="http://brainhack-proceedings.github.io/template">BrainHack proceedings template webpage</a>.</p>

<p align="center">Unless you change the name of the repo you forked from <code>template</code> to something else, your page will be published at <i>your_GitHub_handle.github.io/template</i>.</p>


## STEP 2 - Edit your report ✍️


* Place your figures in the [`figures`](figures) folder.

* Edit [`report.md`](report.md) file to create your own report. The template markdown will walk you through how to cite references, add figures and equations etc.

* Edit [`report.bib`](report.bib) to add your bibliography in [BibTeX](http://www.bibtex.org/) format.


| ⚠️ Warning|
| :--- |
|Please do not change the name or the location of [report.md](report.md) and [report.bib](report.bib). Unless you provide an absolute path for your figures, they will be looked for in the `figures` folder.|


**Whenever you push your changes to the `master` branch** (either directly or via merging a branch), GitHub actions will be triggered to update your report. That's it!

If actions run completes successfully, 🟠 (running) will turn into ✅ (success). If your build fails, you will see ❌ instead. In that case, you can read the logs to see what went wrong.
6 changes: 6 additions & 0 deletions archetypes/default.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
draft: true
---

36 changes: 36 additions & 0 deletions config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
baseURL = "//brainhack-proceedings.github.io/template/"
languageCode = "en-us"
title = "BrainHack 2020"
publishdir = "public"
theme = "business-frontpage"

[params]
author = "OHBM Brainhack 2020"
description = "Proceeding page."

[params.navbar]
name = "Ignored"
url = "https://ohbm.github.io/hackathon2020/"

[[params.navbar.nav]]
name = "About"
url = "https://ohbm.github.io/hackathon2020/"

[[params.navbar.nav]]
name = "Papers"
url = "https://brainhack-proceedings.github.io/papers"

[[params.navbar.nav]]
name = "Blog"
url = "https://brainhack-proceedings.github.io/blog"

[[params.navbar.nav]]
name = "Submit"
url = "https://github.com/brainhack-proceedings/submit"

[params.header]
name = "Brainhack proceedings"
tagline = "Brainhack proceedings"

[params.footer]
copyright = "BrainHack"
1 change: 1 addition & 0 deletions data/ghdetails.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"pub_name" : "template","repo":"brainhack-proceedings/template"}
61 changes: 61 additions & 0 deletions data/report.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"report": {
"event": "OHBM Brainhack 2020",
"title": "Title goes here",
"author": [
{
"initials": "JD",
"surname": "Doe",
"firstname": "Jane",
"email": "[email protected]",
"affiliation": "aff1, aff2",
"corref": "aff1"
},
{
"initials": "JJD",
"surname": "Doe",
"firstname": "John J.",
"email": "[email protected]",
"affiliation": "aff2",
"url": "https://jonhdoe.website.com"
}
],
"affiliations": [
{
"id": "aff1",
"orgname": "Research Lab 1, Organization 1",
"street": "street_name_goes_here",
"postcode": "post_code_goes_here",
"city": "Montreal",
"state": "Quebec",
"country": "Canada"
},
{
"id": "aff2",
"orgname": "Research Lab 2, Organization 2",
"street": "street_name_goes_here",
"postcode": "post_code_goes_here",
"city": "Montreal",
"state": "Quebec",
"country": "Canada"
}
],
"summary": "Please write a brief summary of your project. This section will appear on the webpage.",
"url": "http://github.com/repo_owner/repo_name",
"coi": "Please add if there are competing interests. Otherwise, type None.",
"acknow": "The authors would like to thank the organizers and attendees of OHBM Brainhack 2020.",
"contrib": "JD and JJD wrote the software, JD performed tests, and JD and JJD wrote the report.",
"tags": [
"tag1",
"tag2",
"tag3"
],
"supplemental": [
"Material 1",
"Material 2"
],
"bibliography": "report",
"preview": "# Introduction\nThe bibliography (\\code{report.bib}) must respect …",
"basename": "report"
}
}
32 changes: 32 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/sh

#DIR=$(dirname "$0")

#cd $DIR/..

if [[ $(git status -s) ]]
then
echo "The working directory is dirty. Please commit any pending changes."
exit 1;
fi

echo "Deleting old publication"
rm -rf public
mkdir public
git worktree prune
rm -rf .git/worktrees/public/

echo "Checking out gh-pages branch into public"
git worktree add -B gh-pages public origin/gh-pages

echo "Removing existing files"
rm -rf public/*

echo "Generating site"
HUGO_ENV="production" hugo

echo "Updating gh-pages branch"
cd public && git add --all && git commit -m "Deploy to gh-pages"

echo "pushing to publish"
git push origin gh-pages -f
Binary file added figures/brainhack.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added latex/bhgn.pdf
Binary file not shown.
Loading

0 comments on commit 80ff526

Please sign in to comment.