Skip to content

Commit 1cb3aca

Browse files
Merge pull request #7 from Diego-Espindola/issue#54
adicionado o deploy pra ser pelo actions e nao pelo pages
2 parents 11e56b2 + a76804b commit 1cb3aca

File tree

1 file changed

+21
-11
lines changed

1 file changed

+21
-11
lines changed

.github/workflows/docs.yml

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@ jobs:
1717
with:
1818
python-version: '3.12'
1919

20-
- name: Install Python dependencies (mínimas para OpenAPI)
21-
run: |
22-
pip install -r requirements.txt
20+
- name: Install Python dependencies
21+
run: pip install -r requirements.txt
2322

2423

2524
- name: Build Sphinx docs
@@ -34,20 +33,31 @@ jobs:
3433
SQLITE_PATH: /tmp/pynewsdb.db
3534
SQLITE_URL: sqlite+aiosqlite:////tmp/pynewsdb.db
3635
PYTHONPATH: .
37-
run: |
38-
python scripts/export_openapi.py app.main:app openapi.json
36+
run: python scripts/export_openapi.py app.main:app openapi.json
3937

4038
- name: Set up Node.js
4139
uses: actions/setup-node@v4
4240
with:
4341
node-version: '20'
4442

4543
- name: Generate static docs (Redoc)
46-
run: |
47-
npx --yes redoc-cli bundle openapi.json -o docs/index.html
44+
run: npx --yes redoc-cli bundle openapi.json -o docs/index.html
4845

49-
- name: Deploy to GitHub Pages
50-
uses: peaceiris/actions-gh-pages@v4
46+
- name: Upload built site to Pages
47+
uses: actions/upload-pages-artifact@v3
5148
with:
52-
github_token: ${{ secrets.GITHUB_TOKEN }}
53-
publish_dir: ./docs/_build/html
49+
path: docs
50+
51+
deploy:
52+
needs: build-docs
53+
runs-on: ubuntu-latest
54+
permissions:
55+
pages: write
56+
id-token: write
57+
environment:
58+
name: github-pages
59+
url: ${{ steps.deployment.outputs.page_url }}
60+
steps:
61+
- name: Deploy to GitHub Pages
62+
id: deployment
63+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)