Skip to content

Commit

Permalink
Merge branch 'fer/1969' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
fernandolucchesi committed Nov 6, 2023
2 parents 51b17ff + 630e4a6 commit ae5364f
Show file tree
Hide file tree
Showing 3 changed files with 1,158 additions and 1,011 deletions.
68 changes: 60 additions & 8 deletions .github/workflows/dataset-backup.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,78 @@
name: Backup Routine
on:
workflow_dispatch:
#schedule:
# Runs at 02:00 UTC every sunday
# - cron: '0 2 * * 0'
inputs:
dataset:
description: 'Please select the dataset to backup.'
type: choice
options:
- "['global-development']"
- "['global-test']"
- all
required: true
default: all
schedule:
# Runs at 02:00 UTC every sunday
- cron: '0 2 * * 0'
env:
BUILD_ARTIFACT_PATH: ${{ github.workspace }}/backups
jobs:
read-satellites:
runs-on: ubuntu-latest
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v3
- id: set-matrix
name: Read satellites by choice
run: |
MATRIX=$(cat satellites.json)
echo "matrix=${MATRIX}" >> $GITHUB_OUTPUT
- uses: act10ns/slack@v2
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
if: failure()

backup-dataset:
runs-on: ubuntu-latest
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
needs: read-satellites
name: Backup dataset
strategy:
matrix:
dataset: ['global-development'] #${{ fromJson(needs.read-satellites.outputs.matrix) }}
dataset: ${{ (github.event.inputs.dataset != 'all' && fromJson(github.event.inputs.dataset)) || fromJson(needs.read-satellites.outputs.matrix) }}

steps:
- uses: actions/checkout@v2
- name: Export dataset
uses: sanity-io/[email protected]
- uses: actions/checkout@v3
- name: Install pnpm 📦
id: install-pnpm
uses: pnpm/[email protected]
with:
version: '8.5.1'
- name: Cache pnpm modules 💾
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'pnpm'
- name: Install dependencies 🔧
id: install-dependencies
run: |
pnpm sanityv3 install
- name: Export Data
id: export-data
working-directory: ./sanityv3
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
id: upload-backup
uses: actions/upload-artifact@v3
with:
name: backup-tarball
path: backups/${{ matrix.dataset }}.tar.gz
Expand Down
8 changes: 4 additions & 4 deletions sanityv3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@
"@equinor/eds-icons": "^0.17.0",
"@reach/auto-id": "^0.18.0",
"@sanity/asset-utils": "^1.3.0",
"@sanity/client": "^5.4.2",
"@sanity/cross-dataset-duplicator": "^1.2.1",
"@sanity/client": "^6.7.0",
"@sanity/cross-dataset-duplicator": "^1.2.3",
"@sanity/document-internationalization": "^1.1.1",
"@sanity/icons": "^2.3.1",
"@sanity/scheduled-publishing": "^1.2.1",
"@sanity/ui": "^1.3.2",
"@sanity/uuid": "^3.0.2",
"@sanity/vision": "^3.16.7",
"@sanity/vision": "^3.19.1",
"buffer": "^6.0.3",
"hls.js": "^1.4.8",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-is": "^18.2.0",
"rxjs": "^7.8.0",
"sanity": "^3.16.7",
"sanity": "^3.19.1",
"sanity-plugin-documents-pane": "^2.1.0",
"sanity-plugin-iframe-pane": "^2.3.0",
"sanity-plugin-media": "^2.2.2",
Expand Down
Loading

0 comments on commit ae5364f

Please sign in to comment.