Update peter-evans/create-pull-request action to v8 #136
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| name: Build and Deploy Documentation | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| jobs: | |
| mkdocs: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v6 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.14' | |
| - name: Install uv | |
| run: | | |
| python -m pip install --upgrade uv | |
| - name: Install make | |
| run: | | |
| sudo apt-get update && sudo apt-get install -y make | |
| - name: Build MkDocs site | |
| run: make docs | |
| - name: Set destination dir | |
| run: | | |
| if [ "${{ github.event_name }}" == "pull_request" ]; then | |
| echo "DEST_DIR=preview/pr-${{ github.event.pull_request.number }}" >> $GITHUB_ENV | |
| else | |
| echo "DEST_DIR=" >> $GITHUB_ENV | |
| fi | |
| - name: Deploy to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./site | |
| destination_dir: ${{ env.DEST_DIR }} | |
| - name: Add preview link to step summary | |
| if: github.event_name == 'pull_request' | |
| run: | | |
| PREVIEW_URL="https://${{ github.repository_owner }}.github.io/${GITHUB_REPOSITORY##*/}/preview/pr-${{ github.event.pull_request.number }}/" | |
| echo "[$PREVIEW_URL]($PREVIEW_URL)" >> $GITHUB_STEP_SUMMARY |