-
Notifications
You must be signed in to change notification settings - Fork 316
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #272 Closes #269 Closes #191 (hopefully) New template version checklist: - [x] I have updated CITATION and CHANGELOG as appropriate. - [x] I have updated lab-website-template-docs as appropriate. Pending change request: https://greene-lab.gitbook.io/lab-website-template-docs/~/changes/a57wjuxagDtJUR241kyt/basics/components/list - [x] I have checked the testbed as appropriate. --- - use `name` field for all debug/logging steps in workflows - use `jwalton/gh-find-current-pr` to get PR number to be more reliable (in rare cases, `github.event.number` can be empty) - fix bug in "first time setup" workflow where `description` gets appended to `user` due to missing `\n` in printf - rename workflows from `.yml` to `.yaml` for consistency - remove useless "build preview" workflow run in "on schedule" † - dont run "update citations" workflow on PR close, which should hopefully avoid issues discussed in #191. in my testing on a fork (vincerubinetti/lab-website-template), it does. need to use step-level `if` skipping instead of job-level or workflow-level because of [this issue](actions/runner#491 (comment)). - when "on schedule" workflow opens a PR, add hint in body of the PR on how to trigger the live preview workflow - use the `xml_escape` liquid filter wherever a user/third-party provided field is used in an HTML attribute to prevent special characters breaking HTML rendering. example: `aria-label="{{ citation.title }}"` and `citation.title` is `"Lorem Ipsum" dataset`, causing attribute to prematurely close. - change `data_filter` to accept Ruby expressions instead of custom syntax. use Ruby `eval` and define each field in the item as a local variable, e.g. `{"animal": "cat"}` lets you use `filter="animal == 'cat'"`. - fix heading anchor styles - add styles for `<details>` element - fix logo shrinking/growing css bugs † due to a [github limitation](https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs), it wouldn't not run anyway on the auto-created PR. the user must close/reopen the PR, then the regular "on pr" workflow (which includes running "build preview") will run. i've already [updated the docs to talk about this](https://greene-lab.gitbook.io/lab-website-template-docs/basics/citations#periodic-updates). from now on, let's treat auto-opening PR as the only supported way. previously i considered that the user could change `open-pr` to `false` to have "on schedule" commit updated citations directly to `main`, but let's nix that to maintain simplicity. it's probably better that we force the user to review the changes before pushing them to their live site anyway. if we did want to support that in the future, the "build preview" run i removed would have to be changed to a "build site", since we'd want to be re-building the `main` branch version of the site, not a preview for a PR. --------- Co-authored-by: Faisal Alquaddoomi <[email protected]>
- Loading branch information
1 parent
5afb459
commit 52db24e
Showing
36 changed files
with
223 additions
and
112 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 |
---|---|---|
|
@@ -21,8 +21,8 @@ jobs: | |
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# for debugging | ||
- uses: crazy-max/ghaction-dump-context@v2 | ||
- name: Debug dump | ||
uses: crazy-max/ghaction-dump-context@v2 | ||
|
||
- name: Checkout branch contents | ||
uses: actions/checkout@v4 | ||
|
@@ -42,14 +42,22 @@ jobs: | |
id: pages | ||
uses: actions/configure-pages@v4 | ||
|
||
# for debugging | ||
- if: runner.debug == '1' | ||
- uses: jwalton/gh-find-current-pr@master | ||
if: github.event.action != 'closed' | ||
id: pr | ||
with: | ||
state: all | ||
|
||
- name: SSH debug | ||
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 }}" | ||
JEKYLL_ENV=production bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path || '' }}/${{ env.PREVIEWS_FOLDER }}/pr-${{ env.pr }}" | ||
env: | ||
pr: ${{ steps.pr.outputs.pr }} | ||
|
||
- name: Commit preview to Pages branch | ||
uses: rossjrw/[email protected] | ||
|
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 |
---|---|---|
|
@@ -13,8 +13,8 @@ jobs: | |
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# for debugging | ||
- uses: crazy-max/ghaction-dump-context@v2 | ||
- name: Debug dump | ||
uses: crazy-max/ghaction-dump-context@v2 | ||
|
||
- name: Create Pages branch | ||
uses: peterjgrainger/[email protected] | ||
|
@@ -28,8 +28,8 @@ jobs: | |
with: | ||
ref: gh-pages | ||
|
||
# for debugging | ||
- if: runner.debug == '1' | ||
- name: SSH debug | ||
if: runner.debug == '1' | ||
uses: mxschmitt/action-tmate@v3 | ||
|
||
# clean slate, as if starting from orphan branch | ||
|
@@ -70,8 +70,8 @@ jobs: | |
run: | | ||
user="${{ github.repository_owner }}" | ||
description="An engaging 1-3 sentence description of your lab." | ||
printf "USER=${user}" >> $GITHUB_ENV | ||
printf "DESCRIPTION=${description}" >> $GITHUB_ENV | ||
printf "\nUSER=${user}" >> $GITHUB_ENV | ||
printf "\nDESCRIPTION=${description}" >> $GITHUB_ENV | ||
- name: Personalize readme for user | ||
run: | | ||
|
File renamed without changes.
File renamed without changes.
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
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
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.