Skip to content

Commit

Permalink
Split workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgensd committed Apr 30, 2024
1 parent 59b7865 commit 9bcda08
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 37 deletions.
41 changes: 4 additions & 37 deletions .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,10 @@
name: Github Pages
name: Build documentation

on:
push:
branches:
- "**"

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
workflow_call:

jobs:
build:
Expand Down Expand Up @@ -56,27 +43,7 @@ jobs:
run: jupyter book build .

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
uses: actions/upload-artifact@v4
with:
path: ${{ env.PUBLISH_DIR }}

# Single deploy job since we're just deploying
deploy:
if: github.ref == 'refs/heads/main'
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Pages
uses: actions/configure-pages@v3

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
name: documentation
49 changes: 49 additions & 0 deletions .github/workflows/deploy_pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Deploy pages
on:
push:
branches:
- "main"

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
build-docs:
uses: ./.github/workflows/build_docs.yml

build:
runs-on: ubuntu-22.04
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: Download docs artifact
# docs artifact is uploaded by build-docs job
uses: actions/download-artifact@v4
with:
name: documentation
path: "./public"

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: "./public"

- name: Setup Pages
uses: actions/configure-pages@v3

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

0 comments on commit 9bcda08

Please sign in to comment.