Skip to content

.github/workflows/update.yml #141

.github/workflows/update.yml

.github/workflows/update.yml #141

Workflow file for this run

on:
workflow_dispatch: {}
push:
paths:
- .github/workflows/update.yml
- scripts/make-places.js
- scripts/make-sheets.js
- scripts/make-config.js
- scripts/make-pages.js
- raw-data/pages/**
schedule:
- cron: 0 0 * * *
permissions:
contents: write
jobs:
scheduled:
runs-on: ubuntu-latest
steps:
- name: Setup deno
uses: denoland/setup-deno@main
with:
deno-version: v2.3.x
- name: Check out repo
uses: actions/checkout@v2
- name: Fetch data
run: |-
curl "https://docs.google.com/spreadsheets/d/1e7A-maXjmzd0lRcpZpeqjOmfRTZUZMOaxSYQaz_sr8I/gviz/tq?tqx=out:csv&sheet=localities" -o "raw-data/localities.csv"
curl "https://docs.google.com/spreadsheets/d/1e7A-maXjmzd0lRcpZpeqjOmfRTZUZMOaxSYQaz_sr8I/gviz/tq?tqx=out:csv&sheet=layers" -o "raw-data/layers.csv"
curl "https://docs.google.com/spreadsheets/d/1e7A-maXjmzd0lRcpZpeqjOmfRTZUZMOaxSYQaz_sr8I/gviz/tq?tqx=out:csv&sheet=sheets" -o "raw-data/sheets.csv"
curl "https://docs.google.com/spreadsheets/d/1e7A-maXjmzd0lRcpZpeqjOmfRTZUZMOaxSYQaz_sr8I/gviz/tq?tqx=out:csv&sheet=authors" -o "raw-data/authors.csv"
curl "https://docs.google.com/spreadsheets/d/1e7A-maXjmzd0lRcpZpeqjOmfRTZUZMOaxSYQaz_sr8I/gviz/tq?tqx=out:csv&sheet=sources" -o "raw-data/sources.csv"
curl "https://docs.google.com/spreadsheets/d/1e7A-maXjmzd0lRcpZpeqjOmfRTZUZMOaxSYQaz_sr8I/gviz/tq?tqx=out:csv&sheet=statuses" -o "raw-data/statuses.csv"
curl "https://docs.google.com/spreadsheets/d/1e7A-maXjmzd0lRcpZpeqjOmfRTZUZMOaxSYQaz_sr8I/gviz/tq?tqx=out:csv&sheet=groups" -o "raw-data/groups.csv"
curl "https://docs.google.com/spreadsheets/d/1e7A-maXjmzd0lRcpZpeqjOmfRTZUZMOaxSYQaz_sr8I/gviz/tq?tqx=out:csv&sheet=translations" -o "raw-data/translations.csv"
curl "https://docs.google.com/spreadsheets/d/1e7A-maXjmzd0lRcpZpeqjOmfRTZUZMOaxSYQaz_sr8I/gviz/tq?tqx=out:csv&sheet=pages" -o "raw-data/pages.csv"
- name: Process data
run: |-
git diff --quiet raw-data/ \
|| deno run --allow-import --allow-read --allow-write scripts/make-places.js \
&& deno run --allow-import --allow-read --allow-write scripts/make-sheets.js \
&& deno run --allow-import --allow-read --allow-write scripts/make-config.js
deno run --allow-import --allow-read --allow-write scripts/make-pages.js
- name: Commit changes
run: |-
git config user.name "github action"
git config user.email "actions@users.noreply.github.com"
git add -A
timestamp=$(date -u)
git commit -m "Updated data: ${timestamp}" || exit 0
git push