Skip to content

Commit

Permalink
Merge remote-tracking branch 'template/main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewsu committed Apr 20, 2024
2 parents bb90a47 + fcfb29f commit 48d9e02
Show file tree
Hide file tree
Showing 63 changed files with 1,394 additions and 302 deletions.
4 changes: 1 addition & 3 deletions .docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
#! /bin/bash

# print folder contents for debugging
echo "Contents:"
echo ""
printf "\n\nContents:\n\n"
ls
echo ""

# run cite process
python3 _cite/cite.py
Expand Down
35 changes: 35 additions & 0 deletions .github/DISCUSSION_TEMPLATE/general.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
body:
- type: checkboxes
attributes:
label: Checks
options:
- label: I have searched **[the docs](https://greene-lab.gitbook.io/lab-website-template-docs)**, [existing issues](https://github.com/greenelab/lab-website-template/issues), and [existing discussions](https://github.com/greenelab/lab-website-template/discussions) for answers first.
required: true

- type: input
id: repo
attributes:
label: Link to your website repo
description: "In almost all cases, **we cannot help you if you don't provide this**."
placeholder: ex. https://github.com/greenelab/greenelab.com
validations:
required: true

- type: input
id: version
attributes:
label: Version of Lab Website Template you are using
description: See your `CITATION.cff` file.
placeholder: ex. 1.0.0
validations:
required: true

- type: textarea
id: description
attributes:
label: Description
description: |
Describe your issue in as much detail as possible. For example: What happened? What did you expect to happen? How can we reproduce the problem? What browser are you seeing the problem in?
placeholder: Description
validations:
required: true
35 changes: 35 additions & 0 deletions .github/DISCUSSION_TEMPLATE/q-a.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
body:
- type: checkboxes
attributes:
label: Checks
options:
- label: I have searched **[the docs](https://greene-lab.gitbook.io/lab-website-template-docs)**, [existing issues](https://github.com/greenelab/lab-website-template/issues), and [existing discussions](https://github.com/greenelab/lab-website-template/discussions) for answers first.
required: true

- type: input
id: repo
attributes:
label: Link to your website repo
description: "In almost all cases, **we cannot help you if you don't provide this**."
placeholder: ex. https://github.com/greenelab/greenelab.com
validations:
required: true

- type: input
id: version
attributes:
label: Version of Lab Website Template you are using
description: See your `CITATION.cff` file.
placeholder: ex. 1.0.0
validations:
required: true

- type: textarea
id: description
attributes:
label: Description
description: |
Describe your issue in as much detail as possible. For example: What happened? What did you expect to happen? How can we reproduce the problem? What browser are you seeing the problem in?
placeholder: Description
validations:
required: true
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: true
contact_links:
- name: 💬 Start a discussion
url: https://github.com/greenelab/lab-website-template/discussions
about: I need help, I have a question, or other discussion.
- name: 📚 Docs issue
url: https://github.com/greenelab/lab-website-template-docs/issues
about: I have a question or issue related to the template documentation.
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/issue.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: 🐞 Create an issue
description: I think I've discovered a bug, I want to request a feature/change, or other issue.

body:
- type: checkboxes
attributes:
label: Checks
options:
- label: I have searched **[the docs](https://greene-lab.gitbook.io/lab-website-template-docs)**, [existing issues](https://github.com/greenelab/lab-website-template/issues), and [existing discussions](https://github.com/greenelab/lab-website-template/discussions) for answers first.
required: true

- type: input
id: repo
attributes:
label: Link to your website repo
description: "In almost all cases, **we cannot help you if you don't provide this**."
placeholder: ex. https://github.com/greenelab/greenelab.com
validations:
required: true

- type: input
id: version
attributes:
label: Version of Lab Website Template you are using
description: See your `CITATION.cff` file.
placeholder: ex. 1.0.0
validations:
required: true

- type: textarea
id: description
attributes:
label: Description
description: |
Describe your issue in as much detail as possible. For example: What happened? What did you expect to happen? How can we reproduce the problem? What browser are you seeing the problem in?
placeholder: Description
validations:
required: true
15 changes: 12 additions & 3 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
This website is based on the Lab Website Template.
See its documentation for working with this site:
STOP!!!

https://greene-lab.gitbook.io/lab-website-template-docs
You are about to open this pull request against THE TEMPLATE ITSELF. You probably meant to open it against your own website repo.

---

FOR THE TEMPLATE MAINTAINER(S)

New template version checklist:

- [ ] I have updated CITATION and CHANGELOG as appropriate.
- [ ] I have updated lab-website-template-docs as appropriate.
- [ ] I have checked the testbed as appropriate.
4 changes: 4 additions & 0 deletions .github/user_pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
This website is based on the Lab Website Template.
See its documentation for working with this site:

https://greene-lab.gitbook.io/lab-website-template-docs
19 changes: 10 additions & 9 deletions .github/workflows/build-preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,36 +22,37 @@ jobs:

steps:
# for debugging
- name: Print contexts
uses: crazy-max/ghaction-dump-context@v1
- uses: crazy-max/ghaction-dump-context@v2

- name: Checkout branch contents
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.head_ref }}

- name: Install Ruby packages
if: github.event.action != 'closed'
uses: ruby/setup-ruby@v1
uses: ruby/setup-ruby@v1.172.0
with:
ruby-version: "3.0"
ruby-version: "3.1"
bundler-cache: true

- name: Get Pages url
if: github.event.action != 'closed'
id: pages
uses: actions/configure-pages@v2
with:
enablement: false
uses: actions/configure-pages@v4

# for debugging
- if: runner.debug == '1'
uses: mxschmitt/action-tmate@v3

- name: Build preview version of site
if: github.event.action != 'closed'
run: |
JEKYLL_ENV=production bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path || '' }}/${{ env.PREVIEWS_FOLDER }}/pr-${{ github.event.number }}"
- name: Commit preview to Pages branch
uses: rossjrw/pr-preview-action@v1
uses: rossjrw/pr-preview-action@v1.4.7
with:
source-dir: _site
umbrella-dir: ${{ env.PREVIEWS_FOLDER }}
23 changes: 14 additions & 9 deletions .github/workflows/build-site.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,30 +21,35 @@ jobs:

steps:
# for debugging
- name: Print contexts
uses: crazy-max/ghaction-dump-context@v1
- uses: crazy-max/ghaction-dump-context@v2

- name: Checkout branch contents
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install Ruby packages
uses: ruby/setup-ruby@v1
uses: ruby/setup-ruby@v1.172.0
with:
ruby-version: "3.0"
ruby-version: "3.1"
bundler-cache: true

- name: Get Pages url
id: pages
uses: actions/configure-pages@v2
with:
enablement: false
uses: actions/configure-pages@v4

# for debugging
- if: runner.debug == '1'
uses: mxschmitt/action-tmate@v3

- name: Set root url
run: |
printf "\n\nurl: ${{ steps.pages.outputs.origin }}" >> _config.yaml
- name: Build live version of site
run: |
JEKYLL_ENV=production bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path || '' }}"
- name: Commit live site to Pages branch
uses: JamesIves/github-pages-deploy-action@v4
uses: JamesIves/github-pages-deploy-action@v4.5.0
with:
folder: _site
clean-exclude: ${{ env.PREVIEWS_FOLDER }}
Expand Down
34 changes: 19 additions & 15 deletions .github/workflows/first-time-setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,24 @@ jobs:

steps:
# for debugging
- name: Print contexts
uses: crazy-max/ghaction-dump-context@v1
- uses: crazy-max/ghaction-dump-context@v2

- name: Create Pages branch
uses: peterjgrainger/action-create-branch@v2.4.0
uses: peterjgrainger/action-create-branch@v3.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
branch: "gh-pages"

- name: Checkout Pages branch
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: gh-pages

# for debugging
- if: runner.debug == '1'
uses: mxschmitt/action-tmate@v3

# clean slate, as if starting from orphan branch
- name: Clear Pages branch
run: rm -rf * .github .docker .gitignore
Expand All @@ -38,40 +41,41 @@ jobs:
run: touch .nojekyll

- name: Make placeholder homepage
run: echo "Placeholder homepage" > index.html
run: printf "Placeholder homepage" > index.html

- name: Commit changes to Pages branch
uses: stefanzweifel/git-auto-commit-action@v4
uses: stefanzweifel/git-auto-commit-action@v5
with:
branch: gh-pages
commit_message: "Clear branch"

- name: Checkout main branch
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Remove files user doesn't need
run: |
rm -rf \
CHANGELOG.md \
testbed.md \
.github/ISSUE_TEMPLATE \
.github/DISCUSSION_TEMPLATE \
.github/workflows/versioning.yaml \
.github/pull_request_template.md \
- name: Rename files
run: |
mv .github/user_pull_request_template.md .github/pull_request_template.md
mv -f .github/user_pull_request_template.md .github/pull_request_template.md
- name: Set vars for personalization
run: |
user="${{ github.repository_owner }}"
description="An engaging 1-3 sentence description of your lab."
echo "USER=${user}" >> $GITHUB_ENV
echo "DESCRIPTION=${description}" >> $GITHUB_ENV
printf "USER=${user}" >> $GITHUB_ENV
printf "DESCRIPTION=${description}" >> $GITHUB_ENV
- name: Personalize readme for user
run: |
echo "
printf "
# ${{ env.USER }}'s Website
Visit **[website url](#)** 🚀
Expand All @@ -80,7 +84,7 @@ jobs:
" > README.md
- name: Personalize Jekyll config for user
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
script: |
const { readFileSync, writeFileSync } = require("fs");
Expand All @@ -97,7 +101,7 @@ jobs:
writeFileSync(file, contents);
- name: Personalize homepage for user
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
script: |
const { readFileSync, writeFileSync } = require("fs");
Expand All @@ -109,6 +113,6 @@ jobs:
writeFileSync(file, contents);
- name: Commit changed files
uses: stefanzweifel/git-auto-commit-action@v4
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Setup repo"
Loading

0 comments on commit 48d9e02

Please sign in to comment.