Skip to content

Commit

Permalink
Updating deployment file to the latest Github Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
shreyashguptas committed Nov 14, 2024
1 parent 2d7d88e commit 8025842
Showing 1 changed file with 32 additions and 35 deletions.
67 changes: 32 additions & 35 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,47 @@
name: deploy-book

# Only run this when the master branch changes
on:
push:
branches:
- main
- main
# If your git repository has the Jupyter Book source in a subdirectory
# such as `source/`, add it here
paths:
- 'notebooks/**'
- '_config.yml'
- '_toc.yml'
- 'requirements.txt'
- 'index.md'
- '**'

# This job installs dependencies, builds the book, and pushes it to `gh-pages`
jobs:
deploy-book:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
pages: write
id-token: write

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

# Install dependencies
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install dependencies
run: |
pip install -r requirements.txt
# Build the book
- name: Build the book
run: |
jupyter-book build .
# Upload artifact
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: _build/html

- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
cache: 'pip'

- name: Install dependencies
run: |
pip install -r requirements.txt
pip install jupyter-book sphinx-book-theme
- name: Build the book
run: |
jupyter-book config sphinx . # Generate sphinx config
jupyter-book build . --all # Build all files
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: "_build/html"

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
# Deploy to GitHub Pages
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4
if: github.ref == 'refs/heads/main'

0 comments on commit 8025842

Please sign in to comment.