ci: de-matrix GH Pages deploy #23
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
| on: | ||
|
Check failure on line 1 in .github/workflows/ghpages-cleanup.yml
|
||
| schedule: | ||
| - cron: 0 0 * * 6 # midnight on Saturdays | ||
| workflow_dispatch: | ||
| jobs: | ||
| cleanup: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Check out GH Pages branch | ||
| uses: actions/checkout | ||
| with: | ||
| # replace `fetch-depth` with `shallow-since` if and when actions/checkout#619 (or an equivalent) gets merged | ||
| fetch-depth: 0 | ||
| ref: gh-pages | ||
| - name: Mark stale directories for removal | ||
| run: | | ||
| for dir in */; do | ||
| if [ -z "$(git log -n 1 --since "1 month ago" -- "$dir")" ]; then | ||
| git rm -r "$dir" | ||
| fi | ||
| done | ||
| git status | ||
| - name: Commit | ||
| run: "git commit -m 'chore: remove stale GH Pages branches'" | ||
| - name: Push | ||
| run: "git push" | ||