Skip to content

Commit

Permalink
[CI] Cleanup previews only if they actually exist (ukri-excalibur#323)
Browse files Browse the repository at this point in the history
  • Loading branch information
giordano authored May 8, 2024
1 parent 0092cd4 commit 7bbe54a
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/docs_cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ jobs:
ref: gh-pages
- name: Delete preview and push changes
run: |
git config user.name "${{github.actor}}"
git config user.email "${{github.actor_id}}+${{github.actor}}@users.noreply.github.com"
git rm -rf preview/PR${{ github.event.number }}
git commit -m 'Cleanup docs for PR #${{ github.event.number }}'
git push origin gh-pages
preview_directory=preview/PR${{ github.event.number }}
if [[ -d "${preview_directory}" ]]; then
git config user.name "${{github.actor}}"
git config user.email "${{github.actor_id}}+${{github.actor}}@users.noreply.github.com"
git rm -rf "${preview_directory}"
git commit -m 'Cleanup docs for PR #${{ github.event.number }}'
git push origin gh-pages
fi

0 comments on commit 7bbe54a

Please sign in to comment.