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

Versioning #865

Merged
merged 2 commits into from
Dec 21, 2022
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,6 @@ jobs:
- name: Upload to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: _build
folder: _build
target-folder: main
clean: false
72 changes: 72 additions & 0 deletions .github/workflows/docs-manual-versioning.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Manual Docs Versioning
on:
workflow_dispatch:
inputs:
version:
description: 'Documentation version to create'
required: true
commit:
description: 'Commit used to build the Documentation version'
required: false
latest:
description: 'Latest version'
type: boolean

permissions:
contents: write
jobs:
docs:
name: Generate Website for new version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
if: inputs.commit == ''

- uses: actions/checkout@v3
if: inputs.commit != ''
with:
ref: ${{ inputs.commit }}

- uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Install dependencies
run: pip install -r docs/requirements.txt

- name: Install PettingZoo
run: pip install .

- name: Generate environment docs
run: python docs/_scripts/gen_envs_mds.py

- name: Generate environments display
run: python docs/_scripts/gen_envs_display.py

- name: Build
run: sphinx-build -b dirhtml -v docs _build

- name: Move 404
run: mv _build/404/index.html _build/404.html

- name: Update 404 links
run: python docs/_scripts/move_404.py _build/404.html

- name: Remove .doctrees
run: rm -r _build/.doctrees

- name: Upload to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: _build
target-folder: ${{ inputs.version }}
clean: false

- name: Upload to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
if: inputs.latest
with:
folder: _build
clean-exclude: |
*.*.*/
main
62 changes: 62 additions & 0 deletions .github/workflows/docs-versioning.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Docs Versioning
on:
push:
tags:
- 'v?*.*.*'
permissions:
contents: write
jobs:
docs:
name: Generate Website for new version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Get tag
id: tag
uses: dawidd6/action-get-tag@v1
with:
strip_v: true

- name: Install dependencies
run: pip install -r docs/requirements.txt

- name: Install PettingZoo
run: pip install .

- name: Generate environment docs
run: python docs/_scripts/gen_envs_mds.py

- name: Generate environments display
run: python docs/_scripts/gen_envs_display.py

- name: Build
run: sphinx-build -b dirhtml -v docs _build

- name: Move 404
run: mv _build/404/index.html _build/404.html

- name: Update 404 links
run: python docs/_scripts/move_404.py _build/404.html

- name: Remove .doctrees
run: rm -r _build/.doctrees

- name: Upload to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: _build
target-folder: ${{steps.tag.outputs.tag}}
clean: false

- name: Upload to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: _build
clean-exclude: |
*.*.*/
main
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"light_logo": "img/PettingZoo.svg",
"dark_logo": "img/PettingZoo_White.svg",
"gtag": "G-Q4EGMJ3R24",
"versioning": True,
}
html_context: Dict[str, Any] = {}
html_context["conf_py_path"] = "/docs/"
Expand Down