Skip to content

Commit

Permalink
Add parallel deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
AA-Turner committed Apr 20, 2021
1 parent 8d7e29d commit a1d084d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/deploy-gh-pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,13 @@ jobs:
${{ runner.os }}-pip-
${{ runner.os }}-
# Install dependencies and build PEPs using sphinx
- name: 👷‍ Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
make pages
# Install dependencies and build PEPs using sphinx
- name: 🔧 Build PEPs
run: make pages
run: make pages -j$(nproc)

- name: 🚀 Deploy to GitHub pages
uses: JamesIves/[email protected]
Expand Down
15 changes: 10 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Builds PEP files to HTML using sphinx
# Builds PEP files to HTML using docutils or sphinx
# Also contains testing targets

PEP2HTML=pep2html.py
Expand Down Expand Up @@ -55,17 +55,22 @@ lint:
pre-commit --version > /dev/null || python3 -m pip install pre-commit
pre-commit run --all-files

# New Sphinx targets:

SPHINX_JOBS=8
SPHINX_BUILD=$(PYTHON) build.py -j $(SPHINX_JOBS)

pages: rss
$(PYTHON) build.py --index-file
$(SPHINX_BUILD) --index-file

sphinx:
$(PYTHON) build.py
$(SPHINX_BUILD)

fail_on_warning:
$(PYTHON) build.py -f
$(SPHINX_BUILD) --fail-on-warning

check_links:
$(PYTHON) build.py -c
$(SPHINX_BUILD) --builder linkcheck

sphinx_package: all rss
mkdir -p package/peps
Expand Down
4 changes: 3 additions & 1 deletion build.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ def create_parser():
# builders:
parser.add_argument("-b", "--builder", default="html", choices=("html", "dirhtml", "linkcheck"))

# checks
# flags / options
parser.add_argument("-f", "--fail-on-warning", action="store_true")
parser.add_argument("-n", "--nitpicky", action="store_true")
parser.add_argument("-j", "--jobs", type=int)

# extra build steps
parser.add_argument("-i", "--index-file", action="store_true") # for PEP 0
Expand Down Expand Up @@ -41,6 +42,7 @@ def create_parser():
buildername=args.builder,
confoverrides=config_overrides,
warningiserror=args.fail_on_warning,
parallel=args.jobs,
)
app.builder.copysource = False # Prevent unneeded source copying - we link direct to GitHub
app.build()

0 comments on commit a1d084d

Please sign in to comment.