Split docs preview workflows #1
Workflow file for this run
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: Docs Preview Cleanup | |
| on: | |
| pull_request: | |
| types: | |
| - closed | |
| permissions: | |
| contents: write | |
| jobs: | |
| cleanup: | |
| name: Cleanup documentation preview | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| ref: gh-pages | |
| fetch-depth: 0 | |
| - name: Remove documentation preview | |
| run: | | |
| target="previews/PR${{ github.event.pull_request.number }}" | |
| if [ -d "$target" ]; then | |
| rm -rf "$target" | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add -A | |
| git commit -m "Remove preview for PR #${{ github.event.pull_request.number }} [skip ci]" | |
| git push origin HEAD:gh-pages | |
| else | |
| echo "No preview directory to clean." | |
| fi |