From d406196ef16c557f8993d139c323316968fd6c74 Mon Sep 17 00:00:00 2001 From: Padmaja <52911293+padms@users.noreply.github.com> Date: Mon, 30 Oct 2023 19:05:10 +0530 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20Backup=20routine=20workflow=20#1?= =?UTF-8?q?626?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dataset-backup.yaml | 33 +++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/dataset-backup.yaml diff --git a/.github/workflows/dataset-backup.yaml b/.github/workflows/dataset-backup.yaml new file mode 100644 index 000000000..18d0fd2a7 --- /dev/null +++ b/.github/workflows/dataset-backup.yaml @@ -0,0 +1,33 @@ +name: Backup Routine +on: + workflow_dispatch: + schedule: + # Runs at 02:00 UTC every sunday + - cron: '0 2 * * 0' +jobs: + backup-dataset: + runs-on: ubuntu-latest + name: Backup dataset + strategy: + matrix: + dataset: ['global-development'] #${{ fromJson(needs.read-satellites.outputs.matrix) }} + steps: + - uses: actions/checkout@v2 + - name: Export dataset + uses: sanity-io/github-action-sanity@v0.2-alpha + env: + SANITY_AUTH_TOKEN: ${{ secrets.SANITY_DEPLOY }} + with: + args: dataset export ${{ matrix.dataset }} backups/${{ matrix.dataset }}.tar.gz + - name: Upload backup.tar.gz + uses: actions/upload-artifact@v2 + with: + name: backup-tarball + path: backups/${{ matrix.dataset }}.tar.gz + # Fails the workflow if no files are found; defaults to 'warn' + if-no-files-found: error + - uses: act10ns/slack@v1 + with: + status: ${{ job.status }} + steps: ${{ toJson(steps) }} + if: failure()