data update with poha #11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| on: | |
| workflow_dispatch: {} | |
| push: | |
| paths: | |
| - .github/workflows/update.yml | |
| - scripts/make-places.js | |
| 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: v1.10.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" | |
| - name: Process data | |
| run: |- | |
| git diff --quiet raw-data/ || deno run --allow-read --allow-write --unstable scripts/make-places.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 |