Daily Expiry Cleanup #75
This file contains hidden or 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: Daily Expiry Cleanup | |
| on: | |
| schedule: | |
| - cron: '0 0 * * *' # Run daily at midnight UTC | |
| workflow_dispatch: # Allow manual trigger | |
| jobs: | |
| cleanup: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: pip3 install -r scripts/requirements.txt | |
| - name: Install hcloud CLI | |
| run: | | |
| wget -q https://github.com/hetznercloud/cli/releases/latest/download/hcloud-linux-amd64.tar.gz | |
| tar -xzf hcloud-linux-amd64.tar.gz | |
| sudo mv hcloud /usr/local/bin/ | |
| - name: Delete expired servers | |
| env: | |
| HCLOUD_TOKEN: ${{ secrets.HETZNER_API_TOKEN }} | |
| run: python3 scripts/expiry-cleanup.py |