-
Notifications
You must be signed in to change notification settings - Fork 42
39 lines (35 loc) · 1.06 KB
/
backup-sanity.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Backup sanity dateset to gcp
on:
workflow_dispatch:
schedule:
# 12.00 every 3 days
- cron: "0 0 */3 * *"
jobs:
execute:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Required to retrieve git history
- uses: actions/setup-node@v4
with:
node-version: lts/*
cache: yarn
cache-dependency-path: "**/yarn.lock"
- name: Install dependencies
run: cd aksel.nav.no/website && yarn
env:
NPM_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}
- name: Export dataset
run: cd aksel.nav.no/website && yarn backup
env:
SANITY_READ: ${{ secrets.SANITY_READ }}
- name: Upload GCP bucket
uses: "google-github-actions/auth@v2"
with:
credentials_json: "${{ secrets.gcp_credentials_prod }}"
- uses: "google-github-actions/upload-cloud-storage@v2"
with:
path: ./aksel.nav.no/website
destination: "aksel-website-prod/backups"
glob: "backup-*.tar.gz"