diff --git a/.github/workflows/publish-documentation.yml b/.github/workflows/publish-documentation.yml new file mode 100644 index 00000000..0371b486 --- /dev/null +++ b/.github/workflows/publish-documentation.yml @@ -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 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish-pypi.yml similarity index 70% rename from .github/workflows/publish.yml rename to .github/workflows/publish-pypi.yml index 7feac268..9be56227 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish-pypi.yml @@ -1,6 +1,6 @@ --- -name: Upload Python Package +name: Upload Python Package to PyPI on: release: @@ -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 @@ -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