Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no default shell in composite actions #44

Merged
merged 7 commits into from
Jan 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .github/actions/buildbook/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ inputs:
jb-save:
description: "Save the Jupyterbook Build (boolean)"
required: true
token:
description: 'A GitHub Personal Access Token (for publishing)'
required: false

runs:
using: "composite"
steps:
- name: Checkout repository
uses: actions/checkout@v2

JessicaS11 marked this conversation as resolved.
Show resolved Hide resolved
- name: Setup JupyterBook Cache
if: ${{inputs.jb-cache}} == true
uses: actions/cache@v2
Expand All @@ -29,14 +29,15 @@ runs:
- uses: ./.github/actions/setupconda

- name: Build JupyterBook
shell: bash -l {0}
run: |
./scripts/deploy_website.sh

- name: Publish to GitHub Pages
if: ${{inputs.publish-to-gh}} == true
uses: peaceiris/actions-gh-pages@v3
with:
personal_token: ${{ secrets.GH_PAT }}
personal_token: ${{inputs.token}}
publish_dir: book/_build/html
publish_branch: gh-pages

Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/cron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,11 @@ on:
jobs:
build-and-test:
runs-on: ubuntu-20.04
defaults:
run:
shell: bash -l {0}

steps:
- name: Checkout repository
uses: actions/checkout@v2

- uses: ./.github/actions/buildbook
with:
jb-cache: true
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,24 @@ on:
push:
paths:
- 'book/**'
- '{{ cookiecutter.repo_directory }}/**'
- 'scripts/**'
- '.github/workflows/deploy.yaml'

branches:
- main

jobs:
build-and-deploy:
runs-on: ubuntu-20.04
defaults:
run:
shell: bash -l {0}

steps:
- name: Checkout repository
uses: actions/checkout@v2

- uses: ./.github/actions/buildbook
with:
jb-cache: true
publish-to-gh: true
jb-save: true
token: ${{ secrets.GH_PAT }}
7 changes: 1 addition & 6 deletions .github/workflows/manual.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,15 @@ name: Build Without Cache

on:
workflow_dispatch:
# can maybe specify PR branch ref here?
# https://docs.github.com/en/actions/reference/events-that-trigger-workflows#example-workflow-configuration

jobs:
build-and-test:
runs-on: ubuntu-20.04
defaults:
run:
shell: bash -l {0}

steps:
- name: Checkout repository
uses: actions/checkout@v2

- uses: ./.github/actions/buildbook
with:
jb-cache: false
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/netlifypreview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,14 @@ on:
jobs:
add-preview:
runs-on: ubuntu-20.04
defaults:
run:
shell: bash -l {0}
# This workflow accesses secrets and checks out a PR, so only run if labelled
# https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
if: contains(github.event.pull_request.labels.*.name, 'preview')

steps:
- name: Checkout repository
uses: actions/checkout@v2

- uses: ./.github/actions/buildbook
with:
jb-cache: true
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/qaqc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
pull_request:
paths:
- 'book/**'
- '{{ cookiecutter.repo_directory }}/**'
- 'scripts/**'
- '.github/workflows/qaqc.yaml'
branches:
- main
Expand Down Expand Up @@ -34,6 +36,7 @@ jobs:
check_filenames: true
check_hidden: true
only_warn: false
skip: '*.js'

# borrowed from https://github.com/ProjectPythia/pythia-foundations/blob/main/.github/workflows/link-checker.yaml
- name: Disable Notebook Execution
Expand Down
11 changes: 3 additions & 8 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,23 @@ name: Test

on:
pull_request_target:
types: [labeled, synchronize]
paths:
jomey marked this conversation as resolved.
Show resolved Hide resolved
- 'book/**'
- '.github/workflows/test.yaml'
- '{{ cookiecutter.repo_directory }}/**'
- 'scripts/**'
- 'binder/**'
branches:
- main

jobs:
build-and-test:
runs-on: ubuntu-20.04
defaults:
run:
shell: bash -l {0}
# This workflow accesses secrets and checks out a PR, so only run if labelled
# https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
if: contains(github.event.pull_request.labels.*.name, 'preview')
jomey marked this conversation as resolved.
Show resolved Hide resolved

steps:
- name: Checkout repository
uses: actions/checkout@v2

- uses: ./.github/actions/buildbook
with:
jb-cache: true
Expand Down