forked from MapComplete/MapComplete
41 lines
1.1 KiB
YAML
41 lines
1.1 KiB
YAML
on:
|
|
workflow_dispatch:
|
|
schedule:
|
|
- cron: "0 2 * * *"
|
|
|
|
jobs:
|
|
daily_data_maintenance:
|
|
runs-on: [ ubuntu-latest, hetzner-access ]
|
|
steps:
|
|
- uses: https://source.mapcomplete.org/actions/checkout@v4
|
|
|
|
- name: Set up Node.js
|
|
uses: https://source.mapcomplete.org/actions/setup-node@v4
|
|
with:
|
|
node-version: "20"
|
|
cache: "npm"
|
|
cache-dependency-path: package-lock.json
|
|
|
|
- name: install deps
|
|
run: npm ci
|
|
shell: bash
|
|
|
|
- name: create community index files
|
|
shell: bash
|
|
run: npm run download:community-index -- -- community-index/
|
|
|
|
- name: upload community index
|
|
shell: bash
|
|
run: |
|
|
zip community-index.zip community-index/*
|
|
scp community-index.zip hetzner:data/
|
|
ssh hetzner "cd data && rm -rf community-index/ && unzip community-index.zip && rm community-index.zip"
|
|
|
|
|
|
- name: Update statistics
|
|
shell: bash
|
|
run: |
|
|
scp -r hetzner:~/data/changeset-metadata/ .
|
|
npm run download:stats -- -- ./
|
|
scp -r ./changeset-metadata/* hetzner:~/data/changeset-metadata/
|
|
|