Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/cleanup-gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Cleanup GitHub Pages on PR Close

on:
pull_request:
types:
- closed

jobs:
cleanup:
runs-on: ubuntu-latest
permissions:
contents: write
pages: write
pull-requests: write

steps:
- uses: actions/checkout@v4

- name: Fetch gh-pages branch
run: |
git fetch origin gh-pages:gh-pages
mkdir gh-pages
git --work-tree=gh-pages checkout gh-pages -- .

- name: Remove PR directory
run: |
rm -rf gh-pages/${{ github.event.pull_request.number }}

- name: Deploy report to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: gh-pages
destination_dir: .
force_orphan: true
Loading