Skip to content

Commit

Permalink
Simplify deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
mphoward committed Feb 17, 2025
1 parent fcc3a9d commit 13a24d5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 31 deletions.
24 changes: 5 additions & 19 deletions .github/workflows/deploy-preview.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: deploy-book-preview
name: deploy-preview

on:
pull_request:
Expand All @@ -8,18 +8,18 @@ on:
- synchronize
- closed

concurrency: preview-${{ github.ref }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false

permissions:
contents: write
pull-requests: write

jobs:
deploy:
deploy-preview:
runs-on: ubuntu-latest

concurrency: pages-main

steps:
- name: Checkout book
uses: actions/checkout@v4
Expand All @@ -35,25 +35,11 @@ jobs:
run: |
pip install -r requirements.txt
- name: Get GitHub Pages URL
id: pages
if: github.event.action != 'closed'
uses: actions/configure-pages@v5

- name: Replace base URL
if: github.event.action != 'closed'
run: |
sed -i 's~baseurl: ""~baseurl: "${{ steps.pages.outputs.base_url }}/preview/pr-${{ github.event.number }}"~g' _config.yml
- name: Build book
if: github.event.action != 'closed'
run: |
jupyter-book build .
- name: Disable Jekyll to serve static HTML
run: |
touch _build/html/.nojekyll
- name: Commit preview to Pages branch
uses: rossjrw/pr-preview-action@v1
with:
Expand Down
16 changes: 5 additions & 11 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
name: deploy-book
name: deploy

on:
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false

permissions:
contents: write

jobs:
deploy:
runs-on: ubuntu-latest

concurrency: pages-main

steps:
- name: Checkout book
uses: actions/checkout@v4
Expand All @@ -27,14 +29,6 @@ jobs:
run: |
pip install -r requirements.txt
- name: Get GitHub Pages URL
id: pages
uses: actions/configure-pages@v5

- name: Replace base URL
run: |
sed -i 's~baseurl: ""~baseurl: "${{ steps.pages.outputs.base_url }}"~g' _config.yml
- name: Build book
run: |
jupyter-book build .
Expand Down
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ execute:
execute_notebooks: force

html:
baseurl: ""
baseurl: https://mphowardlab.github.io/essential-math
home_page_in_navbar: false
use_issues_button: true
use_repository_button: true
Expand Down

0 comments on commit 13a24d5

Please sign in to comment.