Skip to content

Commit

Permalink
Merge pull request #6 from developmentseed/feat/actions
Browse files Browse the repository at this point in the history
Adds github actions to autobuild book on PR merge to main.
  • Loading branch information
wildintellect authored Apr 4, 2024
2 parents 25d4ba0 + 2ce7209 commit c1aaddc
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 13 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: deploy-book

on:
# Trigger the workflow on push to main branch
push:
branches:
- main

env:
BASE_URL: /${{ github.event.repository.name }}

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
deploy-book:
runs-on: ubuntu-latest
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
pages: write
id-token: write
steps:
- uses: actions/checkout@v4

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

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

# Deploy the book's HTML to GitHub Pages
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
13 changes: 13 additions & 0 deletions book/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
geopandas==0.10.2
matplotlib==3.5.1
numpy==1.21.2
pandas==1.3.5
plotly==5.3.1
pystac-client==1.1.0
requests==2.26.0
rasterio==1.2.10
scikit-image==0.18.3
scikit-learn==0.24.2
stackstac==0.4.0
xarray==0.19.0

14 changes: 1 addition & 13 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1 @@
geopandas==0.10.2
matplotlib==3.5.1
numpy==1.21.2
pandas==1.3.5
plotly==5.3.1
pystac-client==1.1.0
requests==2.26.0
rasterio==1.2.10
scikit-image==0.18.3
scikit-learn==0.24.2
stackstac==0.4.0
xarray==0.19.0

jupyter-book

0 comments on commit c1aaddc

Please sign in to comment.