Skip to content

Commit

Permalink
Docs action
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon-Rey committed Nov 13, 2024
1 parent 78d64ec commit 6c5850d
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Build and Push Docs

on:
workflow_dispatch

jobs:
build_docs_and_push:
runs-on: ubuntu-latest

permissions:
contents: write

steps:
- name: Checkout the repository
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12' # Replace with the desired Python version

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Build the documentation
run: |
cd docs-source
make githubclean # Clean any old builds
make github # Build docs
- name: Deploy docs to the repository
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
# Assuming the built docs are in the /docs directory
git add docs
git commit -m "Bot: Auto-Generation of the docs/ folder"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GitHub provides this token for auth
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,10 @@ The pipeline between GitHub and PyPI is automatised. To push a new version do th
- Update the `prefsampling/__init__.py` with the new version number.
- On GitHub, create a new release tagged with the new version number (only admins can do that).
- You're done, the new version of the package is automatically pushed to PyPI after the creation of a GitHub release.

### Building the Docs

If the docs-source has been updated but the `docs/` folder has not, you can build the docs via
a GitHub action here: https://github.com/COMSOC-Community/prefsampling/actions/workflows/docs.yml.
Simply click "Run workflow" and the docs will be built and the built files will be pushed back to
the server.

0 comments on commit 6c5850d

Please sign in to comment.