Skip to content

Commit

Permalink
fix:publishing docs permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
cunla committed May 7, 2024
1 parent 04e3bec commit f7cadc4
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 11 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/publish-documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---

name: Generate and publish documentation

on:
release:
types: [published]

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
environment:
name: pypi
url: https://pypi.org/p/fakeredis
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- name: Publish documentation
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GOOGLE_ANALYTICS_KEY: ${{ secrets.GOOGLE_ANALYTICS_KEY }}
run: |
pip install -r docs/requirements.txt
mkdocs gh-deploy --force
mkdocs --version
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---

name: Upload Python Package
name: Upload Python Package to PyPI

on:
release:
Expand All @@ -10,7 +10,6 @@ jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
environment:
name: pypi
Expand All @@ -34,12 +33,3 @@ jobs:
uses: pypa/gh-action-pypi-publish@v1.8.14
with:
print_hash: true

- name: Publish documentation
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GOOGLE_ANALYTICS_KEY: ${{ secrets.GOOGLE_ANALYTICS_KEY }}
run: |
pip install -r docs/requirements.txt
mkdocs gh-deploy --force
mkdocs --version

0 comments on commit f7cadc4

Please sign in to comment.