Skip to content

Commit 6a6b565

Browse files
committed
Bump to v.1.3.7
1 parent 4cc08bc commit 6a6b565

File tree

150 files changed

+1095
-671
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

150 files changed

+1095
-671
lines changed

.docker/entrypoint.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
#! /bin/bash
22

33
# print folder contents for debugging
4-
echo "Contents:"
5-
echo ""
4+
printf "\n\nContents:\n\n"
65
ls
7-
echo ""
86

97
# run cite process
108
python3 _cite/cite.py

.github/workflows/build-preview.yaml

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,13 @@ jobs:
2121
runs-on: ubuntu-latest
2222

2323
steps:
24-
# for debugging
25-
- name: Print contexts
26-
uses: crazy-max/ghaction-dump-context@v1
24+
- name: Debug dump
25+
if: runner.debug == '1'
26+
uses: crazy-max/ghaction-dump-context@v2
2727

2828
- name: Checkout branch contents
29-
uses: actions/checkout@v3
29+
if: github.event.action != 'closed'
30+
uses: actions/checkout@v4
3031
with:
3132
repository: ${{ github.event.pull_request.head.repo.full_name }}
3233
ref: ${{ github.head_ref }}
@@ -35,23 +36,48 @@ jobs:
3536
if: github.event.action != 'closed'
3637
uses: ruby/setup-ruby@v1
3738
with:
38-
ruby-version: "3.0"
39+
ruby-version: "3.1"
3940
bundler-cache: true
4041

4142
- name: Get Pages url
4243
if: github.event.action != 'closed'
4344
id: pages
44-
uses: actions/configure-pages@v2
45-
with:
46-
enablement: false
45+
uses: actions/configure-pages@v4
46+
47+
- name: SSH debug
48+
if: runner.debug == '1'
49+
uses: mxschmitt/action-tmate@v3
4750

4851
- name: Build preview version of site
4952
if: github.event.action != 'closed'
5053
run: |
5154
JEKYLL_ENV=production bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path || '' }}/${{ env.PREVIEWS_FOLDER }}/pr-${{ github.event.number }}"
5255
5356
- name: Commit preview to Pages branch
54-
uses: rossjrw/pr-preview-action@v1
57+
if: github.event.action != 'closed'
58+
uses: rossjrw/[email protected]
5559
with:
5660
source-dir: _site
5761
umbrella-dir: ${{ env.PREVIEWS_FOLDER }}
62+
63+
- name: Checkout Pages branch
64+
uses: actions/checkout@v4
65+
with:
66+
ref: gh-pages
67+
68+
- name: Clean up preview folders
69+
uses: actions/github-script@v7
70+
with:
71+
script: |
72+
const { rm } = require("fs").promises;
73+
const { PREVIEWS_FOLDER } = process.env;
74+
const { owner, repo } = context.repo;
75+
const prs = (await github.rest.pulls.list({ owner, repo, state: "closed" })).data;
76+
for (const { number } of prs)
77+
await rm(`${PREVIEWS_FOLDER}/pr-${number}`, { recursive: true, force: true });
78+
79+
- name: Commit changed files
80+
uses: stefanzweifel/git-auto-commit-action@v5
81+
with:
82+
branch: gh-pages
83+
commit_message: "Clean up previews"

.github/workflows/build-site.yaml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,31 +20,37 @@ jobs:
2020
runs-on: ubuntu-latest
2121

2222
steps:
23-
# for debugging
24-
- name: Print contexts
25-
uses: crazy-max/ghaction-dump-context@v1
23+
- name: Debug dump
24+
if: runner.debug == '1'
25+
uses: crazy-max/ghaction-dump-context@v2
2626

2727
- name: Checkout branch contents
28-
uses: actions/checkout@v3
28+
uses: actions/checkout@v4
2929

3030
- name: Install Ruby packages
3131
uses: ruby/setup-ruby@v1
3232
with:
33-
ruby-version: "3.0"
33+
ruby-version: "3.1"
3434
bundler-cache: true
3535

3636
- name: Get Pages url
3737
id: pages
38-
uses: actions/configure-pages@v2
39-
with:
40-
enablement: false
38+
uses: actions/configure-pages@v4
39+
40+
- name: SSH debug
41+
if: runner.debug == '1'
42+
uses: mxschmitt/action-tmate@v3
43+
44+
- name: Set root url
45+
run: |
46+
printf "\n\nurl: ${{ steps.pages.outputs.origin }}" >> _config.yaml
4147
4248
- name: Build live version of site
4349
run: |
4450
JEKYLL_ENV=production bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path || '' }}"
4551
4652
- name: Commit live site to Pages branch
47-
uses: JamesIves/github-pages-deploy-action@v4
53+
uses: JamesIves/github-pages-deploy-action@v4.5.0
4854
with:
4955
folder: _site
5056
clean-exclude: ${{ env.PREVIEWS_FOLDER }}

.github/workflows/first-time-setup.yaml

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,74 +13,83 @@ jobs:
1313
runs-on: ubuntu-latest
1414

1515
steps:
16-
# for debugging
17-
- name: Print contexts
18-
uses: crazy-max/ghaction-dump-context@v1
16+
- name: Debug dump
17+
if: runner.debug == '1'
18+
uses: crazy-max/ghaction-dump-context@v2
1919

2020
- name: Create Pages branch
21-
uses: peterjgrainger/action-create-branch@v2.4.0
21+
uses: peterjgrainger/action-create-branch@v3.0.0
2222
env:
2323
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2424
with:
2525
branch: "gh-pages"
2626

2727
- name: Checkout Pages branch
28-
uses: actions/checkout@v3
28+
uses: actions/checkout@v4
2929
with:
3030
ref: gh-pages
3131

32+
- name: SSH debug
33+
if: runner.debug == '1'
34+
uses: mxschmitt/action-tmate@v3
35+
3236
# clean slate, as if starting from orphan branch
3337
- name: Clear Pages branch
34-
run: rm -rf * .github .docker .gitignore
38+
run: rm -rf ./* .github .docker .gitignore
3539

3640
# prevent GitHub from running Jekyll a second time after build
3741
- name: Make .nojekyll file
3842
run: touch .nojekyll
3943

4044
- name: Make placeholder homepage
41-
run: echo "Placeholder homepage" > index.html
45+
run: printf "Placeholder homepage" > index.html
4246

4347
- name: Commit changes to Pages branch
44-
uses: stefanzweifel/git-auto-commit-action@v4
48+
uses: stefanzweifel/git-auto-commit-action@v5
4549
with:
4650
branch: gh-pages
4751
commit_message: "Clear branch"
4852

4953
- name: Checkout main branch
50-
uses: actions/checkout@v3
54+
uses: actions/checkout@v4
5155

5256
- name: Remove files user doesn't need
5357
run: |
5458
rm -rf \
5559
CHANGELOG.md \
5660
testbed.md \
5761
.github/ISSUE_TEMPLATE \
62+
.github/DISCUSSION_TEMPLATE \
5863
.github/workflows/versioning.yaml \
5964
.github/pull_request_template.md \
60-
65+
6166
- name: Rename files
6267
run: |
63-
mv .github/user_pull_request_template.md .github/pull_request_template.md
68+
mv -f .github/user_pull_request_template.md .github/pull_request_template.md
6469
6570
- name: Set vars for personalization
6671
run: |
6772
user="${{ github.repository_owner }}"
6873
description="An engaging 1-3 sentence description of your lab."
69-
echo "USER=${user}" >> $GITHUB_ENV
70-
echo "DESCRIPTION=${description}" >> $GITHUB_ENV
74+
printf "\nUSER=%s" "$user" >> "$GITHUB_ENV"
75+
printf "\nDESCRIPTION=%s" "$description" >> "$GITHUB_ENV"
7176
7277
- name: Personalize readme for user
7378
run: |
74-
echo "
75-
# ${{ env.USER }}'s Website
79+
printf "
80+
![on-push](../../actions/workflows/on-push.yaml/badge.svg)
81+
![on-pull-request](../../actions/workflows/on-pull-request.yaml/badge.svg)
82+
![on-schedule](../../actions/workflows/on-schedule.yaml/badge.svg)
83+
84+
# %s's Website
7685
77-
Visit **[website url](#)** 🚀
86+
Visit **[website url](#)** 🚀
7887
79-
_Built with [Lab Website Template](https://greene-lab.gitbook.io/lab-website-template-docs)_
80-
" > README.md
88+
_Built with [Lab Website Template](https://greene-lab.gitbook.io/lab-website-template-docs)_
89+
" "${{ env.USER }}" > README.md
8190
8291
- name: Personalize Jekyll config for user
83-
uses: actions/github-script@v6
92+
uses: actions/github-script@v7
8493
with:
8594
script: |
8695
const { readFileSync, writeFileSync } = require("fs");
@@ -97,7 +106,7 @@ jobs:
97106
writeFileSync(file, contents);
98107
99108
- name: Personalize homepage for user
100-
uses: actions/github-script@v6
109+
uses: actions/github-script@v7
101110
with:
102111
script: |
103112
const { readFileSync, writeFileSync } = require("fs");
@@ -109,6 +118,6 @@ jobs:
109118
writeFileSync(file, contents);
110119
111120
- name: Commit changed files
112-
uses: stefanzweifel/git-auto-commit-action@v4
121+
uses: stefanzweifel/git-auto-commit-action@v5
113122
with:
114-
commit_message: "Setup repo"
123+
commit_message: "Set up repo"

.github/workflows/on-pages.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
# only run on user instance of template, not template itself
2121
if: github.repository != 'greenelab/lab-website-template'
2222
uses: ./.github/workflows/update-url.yaml
23+
2324
build-site:
2425
needs: update-url
2526
if: needs.update-url.outputs.changed == 'true'

.github/workflows/on-pull-request.yml renamed to .github/workflows/on-pull-request.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ permissions:
1414
pull-requests: write
1515

1616
jobs:
17-
# update-citations:
18-
# uses: ./.github/workflows/update-citations.yaml
17+
update-citations:
18+
uses: ./.github/workflows/update-citations.yaml
1919

2020
build-preview:
21-
# needs: update-citations
21+
needs: update-citations
2222
uses: ./.github/workflows/build-preview.yaml

.github/workflows/on-push.yml renamed to .github/workflows/on-push.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ permissions:
1414
pull-requests: write
1515

1616
jobs:
17-
# update-citations:
18-
# # skip first run because nothing enabled or setup yet
19-
# if: github.run_number != 1
20-
# uses: ./.github/workflows/update-citations.yaml
17+
update-citations:
18+
# skip first run because nothing enabled or setup yet
19+
if: github.run_number != 1
20+
uses: ./.github/workflows/update-citations.yaml
2121

2222
build-site:
23-
# needs: update-citations
23+
needs: update-citations
2424
uses: ./.github/workflows/build-site.yaml

.github/workflows/update-citations.yaml

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,54 +28,74 @@ jobs:
2828
timeout-minutes: 15
2929

3030
steps:
31-
# for debugging
32-
- name: Print contexts
33-
uses: crazy-max/ghaction-dump-context@v1
31+
- name: Debug dump
32+
if: runner.debug == '1'
33+
uses: crazy-max/ghaction-dump-context@v2
3434

3535
- name: Checkout branch contents
36-
uses: actions/checkout@v3
36+
if: github.event.action != 'closed'
37+
uses: actions/checkout@v4
3738
with:
3839
repository: ${{ github.event.pull_request.head.repo.full_name }}
3940
ref: ${{ github.head_ref }}
4041

41-
- name: Setup Python
42-
uses: actions/setup-python@v4
42+
- name: Set up Python
43+
if: github.event.action != 'closed'
44+
uses: actions/setup-python@v5
4345
with:
4446
python-version: "3.11"
4547
cache: "pip"
4648
cache-dependency-path: "**/requirements.txt"
4749

4850
- name: Install Python packages
51+
if: github.event.action != 'closed'
4952
run: |
5053
python -m pip install --upgrade --requirement ./_cite/requirements.txt
5154
55+
- name: SSH debug
56+
if: runner.debug == '1'
57+
uses: mxschmitt/action-tmate@v3
58+
5259
- name: Build updated citations
60+
if: github.event.action != 'closed'
5361
run: python _cite/cite.py
5462
timeout-minutes: 15
5563

64+
- name: Commit cache
65+
if: failure()
66+
uses: stefanzweifel/git-auto-commit-action@v5
67+
with:
68+
file_pattern: "**/.cache/**"
69+
commit_message: "Commit cache"
70+
5671
- name: Check if citations changed
72+
if: github.event.action != 'closed'
5773
id: changed
58-
uses: tj-actions/verify-changed-files@v13
74+
uses: tj-actions/verify-changed-files@v18
5975
with:
6076
files: |
6177
_data/citations.yaml
6278
6379
- name: Commit updated citations to branch
6480
if: |
81+
github.event.action != 'closed' &&
6582
steps.changed.outputs.files_changed == 'true' &&
6683
inputs.open-pr != true
67-
uses: stefanzweifel/git-auto-commit-action@v4
84+
uses: stefanzweifel/git-auto-commit-action@v5
6885
with:
6986
commit_message: "Update citations"
7087

7188
- name: Open pull request with updated citations
7289
if: |
90+
github.event.action != 'closed' &&
7391
steps.changed.outputs.files_changed == 'true' &&
7492
inputs.open-pr == true
75-
uses: peter-evans/create-pull-request@v4
93+
uses: peter-evans/create-pull-request@v6
7694
with:
7795
branch: citation-update
7896
title: Periodic citation update
97+
body: |
98+
To see a live preview of this PR, close (don't merge) and reopen it.
7999
80100
outputs:
81-
changed: ${{ steps.changed.outputs.files_changed }}
101+
changed: ${{ steps.changed.outputs.files_changed || false }}

0 commit comments

Comments
 (0)