Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
72209f6
feat(docs): configurar GitHub Actions para publicação no GitHub Pages
Diego-Espindola Oct 3, 2025
9ed8c3d
Merge pull request #1 from Diego-Espindola/issue#54
Diego-Espindola Oct 3, 2025
2fa1c48
Feat(docs): Adicionado requirementes.txt
Diego-Espindola Oct 3, 2025
9743c62
Merge pull request #2 from Diego-Espindola/issue#54
Diego-Espindola Oct 3, 2025
0d127c0
Update docs.yml
Diego-Espindola Oct 3, 2025
33ddd2e
Update docs.yml
Diego-Espindola Oct 3, 2025
ada398a
feat(docs): documentação automatizada com Sphinx, MyST, Redoc e deplo…
Diego-Espindola Oct 5, 2025
737dca1
Merge pull request #3 from Diego-Espindola/issue#54
Diego-Espindola Oct 5, 2025
a36c949
feat(docs): documentação automatizada com Sphinx, MyST, Redoc e deplo…
Diego-Espindola Oct 5, 2025
004af79
Merge pull request #4 from Diego-Espindola/issue#54
Diego-Espindola Oct 5, 2025
e443595
corrigir publish dir
Diego-Espindola Oct 5, 2025
443ce1e
Merge branch 'main' into issue#54
Diego-Espindola Oct 5, 2025
e4b0438
Merge pull request #5 from Diego-Espindola/issue#54
Diego-Espindola Oct 5, 2025
d0ba4e8
update docs.yml
Diego-Espindola Oct 5, 2025
88013d2
Merge branch 'issue#54' of https://github.com/Diego-Espindola/PyNewsS…
Diego-Espindola Oct 5, 2025
0328ca7
Merge pull request #6 from Diego-Espindola/issue#54
Diego-Espindola Oct 5, 2025
57de450
Update docs.yml
Diego-Espindola Oct 5, 2025
2907483
Update docs.yml
Diego-Espindola Oct 5, 2025
2e99e17
Update requirements.txt
Diego-Espindola Oct 5, 2025
11e56b2
Update requirements.txt
Diego-Espindola Oct 5, 2025
a76804b
adicionado o deploy pra ser pelo actions e nao pelo pages
Diego-Espindola Oct 5, 2025
1cb3aca
Merge pull request #7 from Diego-Espindola/issue#54
Diego-Espindola Oct 5, 2025
66709e1
Update docs.yml
Diego-Espindola Oct 5, 2025
8525ae5
Update index.md
Diego-Espindola Oct 6, 2025
9151c5b
Update index.md
Diego-Espindola Oct 6, 2025
3a18c36
Update docs.yml
Diego-Espindola Oct 6, 2025
08ae4f8
Update docs.yml
Diego-Espindola Oct 6, 2025
5469b4d
Update docs.yml
Diego-Espindola Oct 6, 2025
85cdd6e
Update readme.md
Diego-Espindola Oct 6, 2025
8c10e62
Merge pull request #8 from Diego-Espindola/main
Diego-Espindola Oct 6, 2025
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
59 changes: 59 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Deploy API Docs to GitHub Pages

on:
push:
branches: [ main ]
workflow_dispatch:

jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Copia README.md para docs/
run: tail -n +2 README.md >> docs/readme.md

- name: Disable Jekyll
run: touch docs/.nojekyll

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'

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

- name: Export OpenAPI schema
env:
SECRET_KEY: dummy
ALGORITHM: HS256
ACCESS_TOKEN_EXPIRE_MINUTES: 20
SQLITE_PATH: /tmp/pynewsdb.db
SQLITE_URL: sqlite+aiosqlite:////tmp/pynewsdb.db
PYTHONPATH: .
run: python scripts/export_openapi.py app.main:app docs/openapi.json

- name: Build Sphinx docs (com Redoc embutido)
run: sphinx-build -b html docs/ docs/_build/html

- name: Upload built site to Pages
uses: actions/upload-pages-artifact@v3
with:
path: docs/_build/html

deploy:
needs: build-docs
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
7 changes: 7 additions & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# API

Abaixo está a especificação OpenAPI do PyNewsServer:

```{redoc}
../openapi.json
```
45 changes: 45 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# -- Project information -----------------------------------------------------
project = "pynewsserver"
author = "PyNews"

# -- General configuration ---------------------------------------------------
extensions = [
"myst_parser",
"sphinx_rtd_theme",
"sphinxcontrib.redoc",
"sphinx_copybutton",
]

myst_enable_extensions = [
"colon_fence",
"deflist",
"linkify",
"substitution",
]

source_suffix = {
".rst": "restructuredtext",
".md": "markdown",
}

master_doc = "index"

exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]

# -- Options for HTML output -------------------------------------------------
html_theme = "sphinx_rtd_theme"
html_title = "Documentação - PyNewsServer"
html_static_path = ['_static']

# -- Options for sphinxcontrib-redoc -----------------------------------------
redoc = [
{
"name": "OpenAPI",
"page": "api",
"spec": "../openapi.json",
"embed": True,
"opts": {
"hide-hostname": True
}
},
]
9 changes: 9 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Documentação do PyNewsServer

```{toctree}
:maxdepth: 2
:caption: Sumário

readme
api
```
2 changes: 2 additions & 0 deletions docs/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Documentação do PyNewsServer
<!-- Este arquivo será sobrescrito automaticamente pelo workflow do GitHub Actions. -->
Loading