Skip to content

Commit

Permalink
docs: fix action (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey authored Oct 25, 2024
1 parent d440bc7 commit 4d5e2d3
Show file tree
Hide file tree
Showing 11 changed files with 46 additions and 707 deletions.
90 changes: 36 additions & 54 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -1,59 +1,41 @@
name: Docs

on:
push:
branches: [main]
release:
types: [released]
pull_request:
types: [opened, synchronize]
push:
branches: [main]
release:
types: [released]
pull_request:
types: [opened, synchronize]

concurrency:
# Cancel older, in-progress jobs from the same PR, same workflow.
# use run_id if the job is triggered by a push to ensure
# push-triggered jobs to not get canceled.
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
docs:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install .[doc]
- name: Build HTML artifact
run: python build_docs.py

- name: Upload HTML artifact
uses: actions/upload-artifact@v1
with:
name: DocumentationHTML
path: docs/_build/ape-alchemy

- name: Commit and publish documentation changes to gh-pages branch
run: |
if [[ "${GITHUB_EVENT_NAME}" =~ "pull_request" ]]; then
echo "skipping 'git commit' step for PR"
else
git clone https://github.com/${GITHUB_REPOSITORY} --branch gh-pages --single-branch gh-pages
cp -r docs/_build/ape-alchemy/* gh-pages/
cd gh-pages
touch .nojekyll
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -m "Update documentation" -a || true
fi
- name: Push changes
uses: ad-m/github-push-action@master
if: ${{ github.event_name != 'pull_request' }}
with:
branch: gh-pages
directory: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
docs:
runs-on: ubuntu-latest

permissions:
contents: write

steps:
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install .[doc]
- name: Ape Docs
uses: apeworx/sphinx-ape@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: check-yaml

Expand All @@ -10,7 +10,7 @@ repos:
- id: isort

- repo: https://github.com/psf/black
rev: 24.8.0
rev: 24.10.0
hooks:
- id: black
name: black
Expand All @@ -21,13 +21,13 @@ repos:
- id: flake8

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.11.1
rev: v1.13.0
hooks:
- id: mypy
additional_dependencies: [types-PyYAML, types-requests, pydantic, types-setuptools]

- repo: https://github.com/executablebooks/mdformat
rev: 0.7.17
rev: 0.7.18
hooks:
- id: mdformat
additional_dependencies: [mdformat-gfm, mdformat-frontmatter, mdformat-pyproject]
Expand Down
214 changes: 0 additions & 214 deletions docs/_static/custom.css

This file was deleted.

36 changes: 0 additions & 36 deletions docs/_static/custom.js

This file was deleted.

Loading

0 comments on commit 4d5e2d3

Please sign in to comment.