diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml new file mode 100644 index 0000000..af22980 --- /dev/null +++ b/.github/workflows/build-docs.yml @@ -0,0 +1,50 @@ +name: Build Sphinx Documentation + +on: + push: + branches: [ "*" ] # Run on every branch + workflow_dispatch: + +permissions: + contents: read + +jobs: + build-docs: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.11" + cache: "pip" + cache-dependency-path: "requirements.txt" + + - name: Install documentation requirements + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Build HTML documentation + run: | + make -C docs html + + - name: Create dated ZIP file + shell: bash + run: | + DATE="$(date +%Y%m%d)" + ZIPFILE="docs-${DATE}.zip" + cd docs/build/html + # creates docs/build/docs-YYYYMMDD.zip + zip -r "../${ZIPFILE}" . + + - name: Upload ZIP artifact + uses: actions/upload-artifact@v4 + with: + name: docs-zip-${{ github.ref_name }} + path: docs/build/docs-*.zip + if-no-files-found: error + retention-days: 7