Skip to content

Commit

Permalink
new version of lwt (#138)
Browse files Browse the repository at this point in the history
* merge changes

* Update citations

* initial fixes

* rm example posts

* fixes to lwt merge

* fix merge errors

* remove unneeded file

---------

Co-authored-by: cgreene <[email protected]>
  • Loading branch information
cgreene and cgreene authored Jan 28, 2025
1 parent ed9d6d6 commit a08e1f5
Show file tree
Hide file tree
Showing 47 changed files with 1,727 additions and 1,232 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/build-preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -32,7 +32,7 @@ jobs:

- name: Install Ruby packages
if: github.event.action != 'closed'
uses: ruby/setup-ruby@v1.172.0
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.1"
bundler-cache: true
Expand All @@ -43,12 +43,13 @@ jobs:
uses: actions/configure-pages@v4

- uses: jwalton/gh-find-current-pr@master
if: github.event.action != 'closed'
id: pr
with:
state: all

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

- name: Build preview version of site
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/build-site.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ 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

- name: Install Ruby packages
uses: ruby/setup-ruby@v1.172.0
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.1"
bundler-cache: true
Expand All @@ -36,8 +36,8 @@ jobs:
id: pages
uses: actions/configure-pages@v4

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

- name: Set root url
Expand Down
22 changes: 13 additions & 9 deletions .github/workflows/first-time-setup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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
Expand Down Expand Up @@ -70,17 +70,21 @@ 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: |
printf "
# ${{ env.USER }}'s Website
![on-push](../../actions/workflows/on-push.yaml/badge.svg)
![on-pull-request](../../actions/workflows/on-pull-request.yaml/badge.svg)
![on-schedule](../../actions/workflows/on-schedule.yaml/badge.svg)
Visit **[website url](#)** 🚀
# ${{ env.USER }}'s Website
_Built with [Lab Website Template](https://greene-lab.gitbook.io/lab-website-template-docs)_
Visit **[website url](#)** 🚀
_Built with [Lab Website Template](https://greene-lab.gitbook.io/lab-website-template-docs)_
" > README.md
- name: Personalize Jekyll config for user
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/on-pull-request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: on-pull-request
run-name: on pull request activity

on:
pull_request_target:
types:
- opened
- reopened
- synchronize
- closed

permissions:
contents: write
pull-requests: write

jobs:
update-citations:
uses: ./.github/workflows/update-citations.yaml

build-preview:
needs: update-citations
uses: ./.github/workflows/build-preview.yaml
24 changes: 24 additions & 0 deletions .github/workflows/on-push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: on-push
run-name: on push to main

on:
push:
branches:
- main

# run if user manually requests it
workflow_dispatch:

permissions:
contents: write
pull-requests: write

jobs:
update-citations:
# skip first run because nothing enabled or setup yet
if: github.run_number != 1
uses: ./.github/workflows/update-citations.yaml

build-site:
needs: update-citations
uses: ./.github/workflows/build-site.yaml
5 changes: 0 additions & 5 deletions .github/workflows/on-schedule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,3 @@ jobs:
uses: ./.github/workflows/update-citations.yaml
with:
open-pr: true

build-preview:
needs: update-citations
if: needs.update-citations.outputs.changed == 'true'
uses: ./.github/workflows/build-preview.yaml
26 changes: 21 additions & 5 deletions .github/workflows/update-citations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,35 +28,47 @@ jobs:
timeout-minutes: 15

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

- name: Checkout branch contents
if: github.event.action != 'closed'
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.head_ref }}

- name: Setup Python
if: github.event.action != 'closed'
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip"
cache-dependency-path: "**/requirements.txt"

- name: Install Python packages
if: github.event.action != 'closed'
run: |
python -m pip install --upgrade --requirement ./_cite/requirements.txt
# for debugging
- if: runner.debug == '1'
- name: SSH debug
if: runner.debug == '1'
uses: mxschmitt/action-tmate@v3

- name: Build updated citations
if: github.event.action != 'closed'
run: python _cite/cite.py
timeout-minutes: 15

- name: Commit cache
if: failure()
uses: stefanzweifel/git-auto-commit-action@v5
with:
file_pattern: "**/.cache/**"
commit_message: "Commit cache"

- name: Check if citations changed
if: github.event.action != 'closed'
id: changed
uses: tj-actions/verify-changed-files@v18
with:
Expand All @@ -65,6 +77,7 @@ jobs:
- name: Commit updated citations to branch
if: |
github.event.action != 'closed' &&
steps.changed.outputs.files_changed == 'true' &&
inputs.open-pr != true
uses: stefanzweifel/git-auto-commit-action@v5
Expand All @@ -73,12 +86,15 @@ jobs:

- name: Open pull request with updated citations
if: |
github.event.action != 'closed' &&
steps.changed.outputs.files_changed == 'true' &&
inputs.open-pr == true
uses: peter-evans/create-pull-request@v6
with:
branch: citation-update
title: Periodic citation update
body: |
To see a live preview of this PR, close (don't merge) and reopen it.
outputs:
changed: ${{ steps.changed.outputs.files_changed }}
changed: ${{ steps.changed.outputs.files_changed || false }}
8 changes: 4 additions & 4 deletions .github/workflows/update-url.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,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: Get Pages url
id: pages
Expand All @@ -29,8 +29,8 @@ jobs:
- name: Checkout branch contents
uses: actions/checkout@v4

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

# update link to site in readme
Expand Down
Loading

0 comments on commit a08e1f5

Please sign in to comment.