Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add automated workflow publishing capabilities #29

Merged
merged 12 commits into from
May 9, 2024
Merged
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
34 changes: 34 additions & 0 deletions .github/workflows/deploy-book.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# deploys the software gardening almanac content through
# GH Pages using Jupyter Book publishing tools.
---
name: deploy book

on:
push:
branches: [main]

jobs:
deploy-book:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install python env
uses: ./.github/actions/install-python-env
- name: Build the jupyter book content
run: |
poetry run poe build-book
- name: Build a PDF from the HTML content
run: |
poetry run poe build-book-pdf
- name: Copy and rename the PDF to the HTML dir
run: |
cp src/almanac/_build/pdf/book.pdf \
src/almanac/_build/html/software-gardening-almanac.pdf
- name: Deploy book to GH Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: src/almanac/_build/html
4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ repos:
- id: check-added-large-files
- id: check-toml
- id: detect-private-key
- repo: https://github.com/python-poetry/poetry
rev: "1.5.1"
hooks:
- id: poetry-check
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

An open-source handbook of applied guidance and tools for sustainable software development and maintenance.

Please see the following links to access published content:

- __Online (HTML)__: https://software-gardening.github.io/almanac/
- __Offline (PDF)__: [software-gardening-almanac.pdf](https://software-gardening.github.io/almanac/software-gardening-almanac.pdf)
vincerubinetti marked this conversation as resolved.
Show resolved Hide resolved

## CONTRIBUTING

Please see our [`CONTRIBUTING.md`](CONTRIBUTING.md) document for more information on how to contribute to this project.
163 changes: 154 additions & 9 deletions poetry.lock

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ pytest = "^8.1.1"
cffconvert = "^2.0.0"
linkchecker = "^10.4.0"
vale = "^3.3.1.0"
pyppeteer = "^2.0.0"

[tool.isort]
profile = "black"
Expand All @@ -29,6 +30,10 @@ exclude_dirs = ["tests"]
build-book.shell = """
jupyter-book build src/almanac
"""
# build a PDF from the HTML content
build-book-pdf.shell = """
jupyter-book build src/almanac --builder pdfhtml
"""
# builds the jupyter book related to this project and opens a new browser window
build-book-dev.shell = """
jupyter-book build src/almanac && \
Expand Down
3 changes: 1 addition & 2 deletions src/almanac/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
# Book settings
title: The Software Gardening Almanac
author: The Software Gardening Community
logo: |
"https://raw.githubusercontent.com/software-gardening/brand/main/logo/logo.png"
logo: assets/software-gardening-logo.png

#######################################################################################
# Execution settings
Expand Down
10 changes: 10 additions & 0 deletions src/almanac/_static/custom.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
.navbar-brand img {
max-width:60%;
}

@media print
{
/* Removes "skip to main content" from pdf output.
Reference: https://github.com/executablebooks/jupyter-book/issues/2045
and https://github.com/pydata/pydata-sphinx-theme/issues/1745 */
.skip-link {
display: none;
}
}
2 changes: 0 additions & 2 deletions src/almanac/_toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ format: jb-book
root: introduction.md
parts:
- chapters:
- title: Preface
file: preface.md
- title: Garden Circle
file: garden-circle/garden-circle.md
sections:
Expand Down
Binary file added src/almanac/assets/software-gardening-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 0 additions & 3 deletions src/almanac/preface.md

This file was deleted.