Skip to content

Commit

Permalink
Update documentation build to use "assets" (#316)
Browse files Browse the repository at this point in the history
* Rename workflow.

* Combine documentation and update workflow.

* Trying to provide multipleriggers.

* Correct trigger name.

* WiP

* Syntax error.

* Check out source before referencing it.

* Manual dispatch still needed.

* Enhanced permissions.

* Correct permission label.

* Molify style checker.
  • Loading branch information
MatthewHambley authored Jun 28, 2024
1 parent 529522b commit 3452576
Show file tree
Hide file tree
Showing 27 changed files with 93 additions and 104 deletions.
52 changes: 0 additions & 52 deletions .github/workflows/build_docs.yml

This file was deleted.

56 changes: 56 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Build Documentation

on:
push:
branches:
- 'main'
workflow_dispatch:

jobs:
sphinx-build:

runs-on: ubuntu-24.04

steps:
- name: Cache Python packages
uses: actions/cache@v4
with:
path: ~/.pip/cache
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pyproject.toml') }}

- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Check out Fab source
uses: actions/checkout@v4

- name: Install documentation tools
run: pip install .[docs]

- name: Generate documentation
run: |
cd Documentation
sphinx-apidoc --separate --module-first -d 5 -f -o source/apidoc ../source/fab
make html
- name: Prepare and upload asset
uses: actions/upload-pages-artifact@v3
with:
path: Documentation/build/html


deploy-documentation:
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{steps.deploy-documentation.outputs.page_url}}
runs-on: ubuntu-24.04
needs: sphinx-build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
File renamed without changes.
70 changes: 35 additions & 35 deletions docs/make.bat → Documentation/make.bat
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions docs/source/conf.py → Documentation/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#
import os
import sys
from fab import __version__ as fab_version
sys.path.insert(0, os.path.abspath('../../source'))


Expand All @@ -22,8 +23,7 @@
author = 'Fab Team'

# The full version, including alpha/beta/rc tags
import fab
release = fab.__version__
release = fab_version

# The version up to the minor patch, for distinguishing multi-version docs
version = '.'.join(release.split('.')[:2])
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file removed docs/.nojekyll
Empty file.
15 changes: 0 additions & 15 deletions docs/readme

This file was deleted.

0 comments on commit 3452576

Please sign in to comment.