Backup Routine #28
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: Backup Routine | |
on: | |
workflow_dispatch: | |
schedule: | |
# Runs at 04:00 UTC on the 1st and 17th of every month | |
- cron: "0 4 */16 * *" | |
jobs: | |
backup-production-dataset: | |
runs-on: ubuntu-20.04 | |
name: Backup production dataset | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: | | |
yarn | |
- name: Export production dataset | |
run: | | |
SANITY_AUTH_TOKEN="${{ secrets.SANITY_VIEWER_TOKEN }}" \ | |
npx sanity dataset export \ | |
production backups/familie-endringslogg-production.tar.gz | |
- name: Upload familie-endringslogg-production.tar.gz | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Backup production dataset | |
path: backups/familie-endringslogg-production.tar.gz | |
# Fails the workflow if no files are found; defaults to 'warn' | |
if-no-files-found: error |