Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v(3.5.11) - GitHub Pages and documentation compilation in actions improvement #445

Merged
merged 17 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
18 changes: 12 additions & 6 deletions .github/workflows/create_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,28 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ vars.PYTHON_VERSION }}
- name: Verify documentation update
uses: dorny/paths-filter@v2
uses: dorny/paths-filter@v3
id: verify-documentation-update
with:
filters: |
doc:
- 'docs/source/**'
- name: Build the latest Docker image
- name: Install dependencies
if: steps.verify-documentation-update.outputs.doc == 'true'
run: docker build . --file Dockerfile --build-arg SINERGYM_EXTRAS=[extras] --tag pullrequest/sinergym:latest
- name: Compile documentation
run: |
sudo apt install pandoc
pip install -e .[doc]
- name: Check build docs
if: steps.verify-documentation-update.outputs.doc == 'true'
run: docker run -t pullrequest/sinergym:latest /bin/bash -c 'sphinx-build -M html docs/source docs/build'
run: sphinx-build -M html docs/source docs/build
- name: Check sphinx spelling
if: steps.verify-documentation-update.outputs.doc == 'true'
run: docker run -t pullrequest/sinergym:latest /bin/bash -c 'sphinx-build -M spelling docs/source docs/build'
run: sphinx-build -M spelling docs/source docs/build

tests:
name: build container and execute pytest
Expand Down
31 changes: 13 additions & 18 deletions .github/workflows/merge_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,27 +61,22 @@ jobs:
filters: |
doc:
- 'docs/source/**'
- name: Build the latest Docker image
if: steps.verify-documentation-update.outputs.doc == 'true'
run: docker build . --file Dockerfile --build-arg SINERGYM_EXTRAS=[extras] --tag pushmain/sinergym:latest
- name: Give permissions to container for see the repository
if: steps.verify-documentation-update.outputs.doc == 'true'
run: git config --global --add safe.directory /sinergym
- name: Compile documentation
- name: Install dependencies
if: steps.verify-documentation-update.outputs.doc == 'true'
run: docker run -v ${GITHUB_WORKSPACE}/docs/compilation:/workspaces/sinergym/docs/compilation -t pushmain/sinergym:latest /bin/bash -c 'sphinx-multiversion docs/source docs/compilation'
- name: Check sphinx spelling
run: |
apt install pandoc
pip install -e .[doc]
- name: Build multiversion docs
if: steps.verify-documentation-update.outputs.doc == 'true'
run: docker run -t pushmain/sinergym:latest /bin/bash -c 'sphinx-build -M spelling docs/source docs/compilation'
- name: Pull local repository (needed if format commit has been done before)
run: sphinx-multiversion docs/source docs/compilation
- name: Deploy to GitHub Pages
if: steps.verify-documentation-update.outputs.doc == 'true'
run: git pull origin main
- name: Commit and push changes if exists
if: steps.verify-documentation-update.outputs.doc == 'true'
uses: stefanzweifel/git-auto-commit-action@v5
with:
file_pattern: docs/compilation/*
commit_message: Documentation source update detected and pushed compilation build directory for Github Pages
run: |
git config --local user.name "GitHub Actions"
git config --local user.email "actions@github.com"
git add docs/compilation
git commit -m "Deploy documentation to GitHub Pages"
git push --force origin `git subtree split --prefix build main`:github-pages

tests:
needs: [apply-autopep8]
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ start_mlflow_tracking.sh
# Source docs _build directory generation using RST preview in Visual Studio Code
docs/source/_build/
docs/build/
docs/compilation/

#dist folder for pypi packages
dist/
Expand Down
Binary file removed docs/compilation/doctrees/environment.pickle
Binary file not shown.
Binary file removed docs/compilation/doctrees/index.doctree
Binary file not shown.
246 changes: 0 additions & 246 deletions docs/compilation/doctrees/nbsphinx/pages/notebooks/basic_example.ipynb

This file was deleted.

Loading
Loading