diff --git a/.github/workflows/backup-events.yml b/.github/workflows/backup-events.yml deleted file mode 100644 index f62694a..0000000 --- a/.github/workflows/backup-events.yml +++ /dev/null @@ -1,59 +0,0 @@ -name: Backup events from Netlify Blobs - -on: - schedule: - - cron: "0 3 1 * *" # 3 AM UTC on the 1st of each month - workflow_dispatch: # allow manual trigger - -jobs: - backup: - runs-on: ubuntu-latest - permissions: - contents: write - - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-node@v4 - with: - node-version: 22 - cache: npm - - - run: npm ci - - - name: Fetch events from Netlify Blobs - env: - NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} - NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} - run: | - node -e " - const { getStore } = require('@netlify/blobs'); - const fs = require('fs'); - async function main() { - const store = getStore({ - name: 'events', - siteID: process.env.NETLIFY_SITE_ID, - token: process.env.NETLIFY_AUTH_TOKEN, - }); - const events = await store.get('all', { type: 'json' }); - fs.writeFileSync('data/events.json', JSON.stringify(events, null, 2)); - console.log('Fetched ' + events.length + ' events'); - } - main().catch(e => { console.error(e); process.exit(1); }); - " - - - name: Check for changes - id: diff - run: | - git diff --quiet data/events.json && echo "changed=false" >> "$GITHUB_OUTPUT" || echo "changed=true" >> "$GITHUB_OUTPUT" - - - name: Commit and push - if: steps.diff.outputs.changed == 'true' - run: | - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - git add data/events.json - git commit -m "Sync events from Netlify Blobs - - Automated monthly backup of live event data." - git push