Cleanup unused staging envs #186
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 unused staging envs | |
on: | |
push: | |
paths: | |
- '.github/workflows/cleanup-staging.*' | |
schedule: | |
- cron: '0 0 * * 0' # every sunday at midnight | |
jobs: | |
master: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout current branch | |
uses: actions/checkout@v2 | |
with: | |
ref: gh-pages | |
- name: Prepare node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '18' | |
- name: Remove old staging folders | |
run: | |
CLEANUP_TOKEN=${{ secrets.CLEANUP_TOKEN }} node .github/workflows/cleanup-staging.js | |
- name: Commit changes | |
run: | | |
git config --global user.email "[email protected]" && \ | |
git config --global user.name "Github Actions" && \ | |
git commit -m "Cleanup staging envs" | |
- name: Push tag | |
run: git push origin gh-pages |