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

Docs publishing #10

Merged
merged 12 commits into from
Dec 14, 2023
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
29 changes: 29 additions & 0 deletions .github/workflows/docs-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: "Sphinx: Render docs"

on: push

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Build docs
run: |
pip install -r ./docs/source/requirements.txt
pip install -r ./requirements.txt
sphinx-build -M html docs/source docs/build

- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: html-docs
path: docs/build/html/

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/build/html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Publish Package
on: push

env:
version: ${{ github.run_id }}-${{ github.run_attempt }}
version: ${{ github.run_id }}.post${{ github.run_attempt }}

jobs:
build:
Expand Down Expand Up @@ -63,6 +63,7 @@ jobs:

permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
if: github.ref == 'refs/heads/dev'

steps:
- name: Download all the dists
Expand All @@ -74,3 +75,7 @@ jobs:
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
- name: Test
run: |
echo Release published on https://test.pypi.org/project/Py-SPW/$version/
echo Install - pip install -i https://test.pypi.org/simple/ Py-SPW==$version
3 changes: 2 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import os
import sys
from datetime import datetime

sys.path.insert(0, os.path.abspath('../..'))

Expand All @@ -14,7 +15,7 @@
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = 'Py-SPW'
copyright = '2023, Teleport'
copyright = f'{datetime.now().year}, Teleport'
author = 'Teleport'
release = __version__

Expand Down
1 change: 1 addition & 0 deletions docs/source/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
sphinx==5.3.0
furo==2023.3.27