Teardown inactive site #205
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: Teardown inactive site | |
| on: | |
| schedule: | |
| - cron: '0 3 * * 6' | |
| workflow_dispatch: | |
| inputs: | |
| slack-notifications: | |
| type: boolean | |
| description: "If checked, send slack notifications when errors occur" | |
| default: false | |
| jobs: | |
| teardown_inactive_deployement: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Teardown deployments older than 1 month | |
| uses: adrianjost/[email protected] | |
| timeout-minutes: 10 | |
| with: | |
| regex: '[1-9]+ month.? ago' | |
| env: | |
| SURGE_TOKEN: ${{ secrets.SURGE_TOKEN_DOC }} | |
| - name: Send message to Slack channel | |
| if: failure() && (github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.slack-notifications == 'true') ) | |
| uses: bonitasoft/notify-slack-action@v1 | |
| with: | |
| keeper-secret-config: ${{ secrets.KSM_CONFIG }} | |
| channel-id: ${{ vars.RD_PLATFORM_SLACK_CHANNEL_ID }} | |
| message: | | |
| :red_circle: The teardown of inactive documentation preview sites has failed! | |
| @channel *We need someone* ! |