Skip to content

chore(deps): update wrangler #3

chore(deps): update wrangler

chore(deps): update wrangler #3

name: Upload to DO Spaces
on:
push:
branches:
- master
paths:
- "packages/@ourworldindata/grapher/src/schema/**"
jobs:
upload:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@master
- uses: ./.github/actions/setup-node-yarn-deps
- uses: ./.github/actions/build-tsc
- uses: hustcer/setup-nu@v3
with:
version: "0.80" # Don't use 0.80 here, as it was a float number and will be convert to 0.8, you can use v0.80/0.80.0 or '0.80'
# Turn all yaml files in the schema directory into json (should only be one)
- run: |
(ls packages/@ourworldindata/grapher/src/schema/*.yaml
| each {|yaml|
open $yaml.name
| to json
| save -f ($yaml.name
| path parse
| upsert extension "json"
| path join) })
shell: nu {0}
# Construct default config objects for all grapher schemas in the schema directory (should only be one)
- run: |
(ls packages/@ourworldindata/grapher/src/schema/grapher-schema.*.json
| each {|json|
node itsJustJavascript/devTools/schema/generate-default-object-from-schema.js $json.name
| save -f ($json.name
| path parse
| upsert stem ($json.name
| path parse
| get stem
| str replace 'grapher-schema' 'grapher-schema.default')
| path join) })
shell: nu {0}
# Get all files in the schema directory that end with digits.json or digits.yaml and
# copy them to a file called .latest.json or .latest.yaml
- run: |
( ls packages/@ourworldindata/grapher/src/schema/*
| where name =~ '\d+.(json|yaml)$'
| get name
| each { |it| cp $it ($it | str replace '\d+.(json|yaml)$' 'latest.$1') })
shell: nu {0}
- run: ls packages/@ourworldindata/grapher/src/schema
shell: nu {0}
# Now upload all files in that folder to digital ocean.
- uses: BetaHuhn/do-spaces-action@v2
with:
access_key: ${{ secrets.DO_ACCESS_KEY}}
secret_key: ${{ secrets.DO_SECRET_KEY }}
space_name: owid-public
space_region: nyc3
source: packages/@ourworldindata/grapher/src/schema
out_dir: schemas