name: "Docs: Release to GitHub pages" on: workflow_dispatch: push: branches: - main paths: - ".github/workflows/docs-release.yaml" - ".ci/mkdocs/mkdocs.yml" - "docs/**" permissions: contents: write jobs: release-docs: name: Release documentation runs-on: ubuntu-22.04 concurrency: group: ${{ github.workflow }}-${{ github.ref }} steps: - name: Get GitHub API token id: get-app-token uses: getsentry/action-github-app-token@v2 with: app_id: ${{ secrets.BJWS_APP_ID }} private_key: ${{ secrets.BJWS_APP_PRIVATE_KEY }} - name: Checkout main branch uses: actions/checkout@v4 with: token: ${{ steps.get-app-token.outputs.token }} fetch-depth: 0 - uses: actions/setup-python@v4 with: python-version: 3.x - name: Install requirements run: pip install -r docs/requirements.txt - name: Build and publish docs run: mkdocs build -f .ci/mkdocs/mkdocs.yml - name: Deploy uses: peaceiris/actions-gh-pages@v3.9.3 if: ${{ github.ref == 'refs/heads/main' }} with: github_token: ${{ steps.get-app-token.outputs.token }} publish_dir: ./site destination_dir: docs user_name: "bjw-s-bot[bot]" user_email: "bjw-s-bot <87358111+bjw-s-bot[bot]@users.noreply.github.com>"