Skip to content

Commit f7cadc4

Browse files
committed
fix:publishing docs permissions
1 parent 04e3bec commit f7cadc4

File tree

2 files changed

+35
-11
lines changed

2 files changed

+35
-11
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
3+
name: Generate and publish documentation
4+
5+
on:
6+
release:
7+
types: [published]
8+
9+
jobs:
10+
publish:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
environment:
15+
name: pypi
16+
url: https://pypi.org/p/fakeredis
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: Set up Python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: "3.11"
23+
- name: Configure Git Credentials
24+
run: |
25+
git config user.name github-actions[bot]
26+
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
27+
- name: Publish documentation
28+
env:
29+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
GOOGLE_ANALYTICS_KEY: ${{ secrets.GOOGLE_ANALYTICS_KEY }}
31+
run: |
32+
pip install -r docs/requirements.txt
33+
mkdocs gh-deploy --force
34+
mkdocs --version

.github/workflows/publish.yml renamed to .github/workflows/publish-pypi.yml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22

3-
name: Upload Python Package
3+
name: Upload Python Package to PyPI
44

55
on:
66
release:
@@ -10,7 +10,6 @@ jobs:
1010
publish:
1111
runs-on: ubuntu-latest
1212
permissions:
13-
contents: write
1413
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
1514
environment:
1615
name: pypi
@@ -34,12 +33,3 @@ jobs:
3433
uses: pypa/gh-action-pypi-publish@v1.8.14
3534
with:
3635
print_hash: true
37-
38-
- name: Publish documentation
39-
env:
40-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41-
GOOGLE_ANALYTICS_KEY: ${{ secrets.GOOGLE_ANALYTICS_KEY }}
42-
run: |
43-
pip install -r docs/requirements.txt
44-
mkdocs gh-deploy --force
45-
mkdocs --version

0 commit comments

Comments
 (0)