Skip to content
Merged

Dev #457

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 19 additions & 32 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,55 +1,42 @@

name: deployment
name: deploy-book
on:
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest
runs-on:
group: LargerInstance
container:
image: rcpeene/openscope_databook:latest

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: main
fetch-tags: true

- name: Installing python
run: |
sudo apt-get update
sudo apt install python3.12
sudo apt-get install build-essential

- name: Installing package without PEP 517
run: python3.12 -m pip install --no-use-pep517 -e .

- name: Upgrading pip
run: pip install --upgrade pip

- name: Installing dependencies
run: |
pip install --upgrade pip setuptools wheel build
pip install markupsafe==2.0.1 --no-cache-dir
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10.11'

- name: Installing package
- name: Install your package
run: pip install -e .

- name: Installing Jupyter book
run: pip install -U jupyter-book

- name: Printing log
run: git status

- name: Printing shortlog
run: git log | git shortlog -sn
- name: Install build requirements
run: |
pip install -r requirements.txt
pip install markupsafe==2.0.1
pip install -U jupyter-book

- name: Build Jupyter book
- name: Build Jupyter Book
run: |
jupyter-book clean ./docs
jupyter-book build ./docs
- name: Deploy book to GitHub pages

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3.6.1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/_build/html

9 changes: 6 additions & 3 deletions databook_utils/insert_authors_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,12 @@ class VersionNumber(Directive):

def run(self):
try:
latest_version = subprocess.check_output(["git", "describe", "--tags", "--abbrev=0"], encoding="utf8")
except:
raise EnvironmentError("There are no git tags from which to get the version number")
latest_version = subprocess.check_output(["git", "describe", "--tags", "--abbrev=0"],
encoding="utf8",
stderr=subprocess.STDOUT # capture stderr in the output
)
except subprocess.CalledProcessError as e:
raise EnvironmentError(f"There are no git tags from which to get the version number.\n" f"error:\n{e.output}") from e

if self.arguments:
paragraph_node = nodes.paragraph()
Expand Down
Loading