File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Doc Previews Cleanup
2+
3+ on :
4+ schedule :
5+ - cron : " 25 22 * * 2"
6+ workflow_dispatch :
7+
8+ concurrency :
9+ # Same group concurrency as the `Documentation.yml` workflow, because they both
10+ # git-push to the same branch, so we want to avoid clashes.
11+ group : docs-pushing
12+
13+ jobs :
14+ doc-preview-cleanup :
15+ runs-on : ubuntu-latest
16+ permissions :
17+ contents : write
18+ steps :
19+ - name : Checkout gh-pages branch
20+ uses : actions/checkout@v6
21+ with :
22+ ref : gh-pages
23+ - name : Delete preview and history + push changes
24+ run : |
25+ if [[ -d previews ]]; then
26+ git config user.name "${{github.actor}}"
27+ git config user.email "${{github.actor_id}}+${{github.actor}}@users.noreply.github.com"
28+ git rm -rf previews/
29+ git commit -m 'Delete previews directory'
30+ git branch gh-pages-new $(echo "Delete history" | git commit-tree HEAD^{tree})
31+ git push --force-with-lease origin gh-pages-new:gh-pages
32+ fi
You can’t perform that action at this time.
0 commit comments