From b46a30b33a6fed2bbd60188aeb28cc12d8474f5b Mon Sep 17 00:00:00 2001 From: Severin Date: Sun, 14 Apr 2024 20:26:26 +0200 Subject: [PATCH] Use reusable workflow --- .github/workflows/call-deploy-book.yml | 23 +++++++++++++++++++++++ .github/workflows/deploy-book-ghpages.yml | 17 ++++++----------- 2 files changed, 29 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/call-deploy-book.yml diff --git a/.github/workflows/call-deploy-book.yml b/.github/workflows/call-deploy-book.yml new file mode 100644 index 0000000..97903c7 --- /dev/null +++ b/.github/workflows/call-deploy-book.yml @@ -0,0 +1,23 @@ +name: call-deploy-book + +on: + push: + branches: + - '**' + # If your git repository has the Jupyter Book within some-subfolder next to + # unrelated files, you can make this run only if a file within that specific + # folder has been modified. + # + # paths: + # - some-subfolder/** + workflow_dispatch: + +jobs: + call-workflow: + uses: TeachBooks/template/.github/workflows/deploy-book-ghpages.yml@main + secrets: inherit + permissions: + contents: read + pages: write + id-token: write + diff --git a/.github/workflows/deploy-book-ghpages.yml b/.github/workflows/deploy-book-ghpages.yml index b6b96bf..682ab42 100644 --- a/.github/workflows/deploy-book-ghpages.yml +++ b/.github/workflows/deploy-book-ghpages.yml @@ -3,18 +3,13 @@ name: deploy-book # Based on: # https://jupyterbook.org/en/stable/publish/gh-pages.html -# Run on a push to any branch, then deploy books from all branches. +# NOTE to template users: +# You should not need to edit this file. This is not the workflow file that is being run on every push. +# Instead, on every push workflow `call-deploy-book` calls the `deploy-book` workflow at the original template repository: +# https://github.com/TeachBooks/template + on: - push: - branches: - - '**' - # If your git repository has the Jupyter Book within some-subfolder next to - # unrelated files, you can make this run only if a file within that specific - # folder has been modified. - # - # paths: - # - some-subfolder/** - workflow_dispatch: + workflow_call: # Inherit configuration variables in the environment, or assign default values. # Configuration variables may be set as explained here: