Cleanup Deployments #113
This file contains 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
name: Cleanup Deployments | |
# cleans up old deployments and only leaves the newest three from each PR. | |
# Does not (yet) remove deployments after an PR was merged or closed. | |
on: | |
schedule: | |
- cron: "0 5 * * 1" | |
jobs: | |
delete-old-deployments: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v3 | |
with: | |
ref: gh-pages | |
- name: Download cleanup script | |
run: wget https://raw.githubusercontent.com/opencast/opencast-editor-test/main/.github/scripts/cleanup-deployments.sh | |
- name: Run cleanup script | |
run: bash cleanup-deployments.sh | |
- name: Commit changes | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
branch: gh-pages | |
commit_message: Cleanup and delete old deployments |