Skip to content

Commit

Permalink
Update to v1.2.1 (#122)
Browse files Browse the repository at this point in the history
* Update to v1.2.0

* add pull_request trigger

* v1.2.1

* remove extra pr trigger
  • Loading branch information
vincerubinetti authored Apr 1, 2024
1 parent c272d00 commit bbb10ec
Show file tree
Hide file tree
Showing 60 changed files with 511 additions and 818 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
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"
17 changes: 10 additions & 7 deletions .github/workflows/update-citations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,16 @@ 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: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip"
Expand All @@ -49,13 +48,17 @@ jobs:
run: |
python -m pip install --upgrade --requirement ./_cite/requirements.txt
# for debugging
- if: runner.debug == '1'
uses: mxschmitt/action-tmate@v3

- name: Build updated citations
run: python _cite/cite.py
timeout-minutes: 15

- name: Check if citations changed
id: changed
uses: tj-actions/verify-changed-files@v13
uses: tj-actions/verify-changed-files@v18
with:
files: |
_data/citations.yaml
Expand All @@ -64,15 +67,15 @@ jobs:
if: |
steps.changed.outputs.files_changed == 'true' &&
inputs.open-pr != true
uses: stefanzweifel/git-auto-commit-action@v4
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Update citations"

- name: Open pull request with updated citations
if: |
steps.changed.outputs.files_changed == 'true' &&
inputs.open-pr == true
uses: peter-evans/create-pull-request@v4
uses: peter-evans/create-pull-request@v6
with:
branch: citation-update
title: Periodic citation update
Expand Down
19 changes: 10 additions & 9 deletions .github/workflows/update-url.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,22 @@ jobs:

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

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

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

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

# update link to site in readme
- name: Update readme
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
script: |
const { readFileSync, writeFileSync } = require("fs");
Expand All @@ -53,14 +54,14 @@ jobs:
- name: Check if readme changed
id: changed
uses: tj-actions/verify-changed-files@v13
uses: tj-actions/verify-changed-files@v18
with:
files: |
README.md
- name: Commit changed files
if: steps.changed.outputs.files_changed == 'true'
uses: stefanzweifel/git-auto-commit-action@v4
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Update url"

Expand Down
Loading

0 comments on commit bbb10ec

Please sign in to comment.