-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: set up GitHub action to install package (#44)
* set up GitHub action to install package Fixes #27 * chore: run actions in PR * chore: run actions in PR * chore: run actions in PR * chore: run actions in PR * chore: run actions in PR * chore: also pages * chore: add deployment workflow * updated constrained decoding notebook * some more installation instructions
- Loading branch information
1 parent
d49ebc5
commit 844f13d
Showing
21 changed files
with
661 additions
and
587 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: deploy-book | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
|
||
jobs: | ||
check-build-book: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: s-weigand/setup-conda@v1 | ||
with: | ||
python-version: 3.11 | ||
- name: Install dependencies | ||
run: | | ||
cd package && python -m pip --no-cache-dir install . && cd .. | ||
pip install jupyter-book | ||
- name: Build the book | ||
run: jupyter-book build -n . | ||
- name: Deploy Jupyter book to GitHub pages | ||
uses: peaceiris/actions-gh-pages@v4 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: _build/html | ||
force_orphan: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,40 @@ | ||
name: deploy-book | ||
name: build-and-check-book | ||
|
||
# Run this when the master or main branch changes | ||
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
# 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/** | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
# This job installs dependencies, builds the book, and pushes it to `gh-pages` | ||
jobs: | ||
deploy-book: | ||
check-build-book: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pages: write | ||
id-token: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
# Install dependencies | ||
- name: Set up Python 3.11 | ||
uses: actions/setup-python@v4 | ||
- uses: actions/checkout@v4 | ||
- uses: s-weigand/setup-conda@v1 | ||
with: | ||
python-version: 3.11 | ||
|
||
- name: Install dependencies | ||
run: | | ||
pip install -r requirements.txt | ||
# (optional) Cache your executed notebooks between runs | ||
# if you have config: | ||
# execute: | ||
# execute_notebooks: cache | ||
- name: cache executed notebooks | ||
uses: actions/cache@v3 | ||
with: | ||
path: _build/.jupyter_cache | ||
key: jupyter-book-cache-${{ hashFiles('requirements.txt') }} | ||
|
||
# Build the book | ||
- name: Build the book | ||
cd package && python -m pip --no-cache-dir install . && cd .. | ||
pip install jupyter-book | ||
- name: Check pre-commit | ||
run: | | ||
jupyter-book build . | ||
# Upload the book's HTML as an artifact | ||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v2 | ||
pip install pre-commit | ||
pre-commit run --all-files || ( git status --short ; git diff ; exit 1 ) | ||
- name: Build the book | ||
run: jupyter-book build -n . | ||
- name: Link Checker | ||
uses: lycheeverse/[email protected] | ||
continue-on-error: true | ||
id: lc | ||
env: | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
with: | ||
path: "_build/html" | ||
|
||
# Deploy the book's HTML to GitHub Pages | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v2 | ||
args: --verbose --exclude --max-redirects 100 --no-progress _build/html**/*.html | ||
- name: Deploy Jupyter book to GitHub pages | ||
uses: peaceiris/actions-gh-pages@v4 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: _build/html | ||
force_orphan: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.