Purge old domains #588
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: Purge old domains | |
on: | |
workflow_dispatch: | |
inputs: | |
days: | |
description: 'Older than (days)' | |
required: false | |
schedule: | |
- cron: '0 3 * * *' | |
jobs: | |
surge-purge: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version-file: '.nvmrc' | |
- name: Install surge | |
run: npm -g install surge | |
- name: Teardown old domains | |
run: npx zx scripts/purge_expired_domains.mjs --olderThan ${{ github.event.inputs.days || '10' }} | |
env: | |
SURGE_LOGIN: ${{ secrets.SURGE_LOGIN }} | |
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }} |