Skip to content

Commit

Permalink
Create DocPreviewsCleanup.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
navidcy authored Aug 26, 2024
1 parent fd37981 commit bd50ab3
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/DocPreviewsCleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Doc Previews Cleanup

on:
schedule:
- cron: "30 5 * * 1"

# Ensure that only one "Doc Previews Cleanup" workflow is force pushing at a time
concurrency:
group: doc-preview-cleanup
cancel-in-progress: false

jobs:
doc-preview-cleanup:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout gh-pages branch
uses: actions/checkout@v4
with:
ref: gh-pages
- name: Delete preview and history + push changes
run: |
git config user.name "Documenter.jl"
git config user.email "[email protected]"
git rm -rf previews/*
git commit -m "delete previews directory"
git branch gh-pages-new $(echo "delete history" | git commit-tree HEAD^{tree})
git push --force origin gh-pages-new:gh-pages

0 comments on commit bd50ab3

Please sign in to comment.