Merge branch 'master' of source.mapcomplete.org:MapComplete/MapComplete

This commit is contained in:
Pieter Vander Vennet 2025-04-28 03:02:39 +02:00
commit 5f4f34734d
32 changed files with 529 additions and 22741 deletions

23
.forgejo/setup/action.yml Normal file
View file

@ -0,0 +1,23 @@
name: 'Setup'
description: 'Checkout code, set up Nodejs, run `npm ci`'
runs:
using: 'composite'
steps:
- uses: actions/checkout@v4
- name: Setup up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: package-lock.json
- name: pwd
run: pwd && ls
shell: bash
- name: install deps
run: npm ci
shell: bash

View file

@ -0,0 +1,23 @@
name: 'Upload_hetzner'
description: 'Uploads a directory to hetzner. Will zip first, for performance'
inputs:
src:
description: 'The source directory'
required: true
dst:
description: "The destination directory. The source directory will be placed _inside_"
required: true
runs:
using: 'composite'
steps:
- name: Upload
shell: bash
run: |
F=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 16)
zip $F.zip ${{ inputs.src }}/*
scp $F.zip hetzner:${{ inputs.dst }}/
ssh hetzner "cd ${{ inputs.dst }} unzip $F.zip && rm $F.zip"

View file

@ -4,21 +4,10 @@ on:
- cron: "0 2 * * *"
jobs:
daily_data_maintenance:
create_community_index:
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
- uses: ./.forgejo/setup
- name: create community index files
shell: bash
@ -31,6 +20,11 @@ jobs:
scp community-index.zip hetzner:data/
ssh hetzner "cd data && rm -rf community-index/ && unzip community-index.zip && rm community-index.zip"
update_statistics:
runs-on: [ ubuntu-latest, hetzner-access ]
steps:
- uses: https://source.mapcomplete.org/actions/checkout@v4
- uses: ./.forgejo/snippets/setup
- name: Update statistics
shell: bash

View file

@ -10,17 +10,7 @@ jobs:
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
- uses: ./.forgejo/setup
- name: create generated dir
run: mkdir -p ./assets/generated

View file

@ -8,17 +8,7 @@ jobs:
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
- uses: ./.forgejo/setup
- name: create generated dir
run: mkdir ./assets/generated

View file

@ -0,0 +1,21 @@
on:
workflow_dispatch:
schedule:
- cron: "0 2 1 * *"
jobs:
update_nsi_logos:
runs-on: [ ubuntu-latest, hetzner-access ]
steps:
- uses: https://source.mapcomplete.org/actions/checkout@v4
- uses: ./.forgejo/setup
- name: Download the NSI-logos
shell: bash
run: npm run download:nsi-logos
- uses: ./.forgejo/upload_hetzner
with:
src: "./public/assets/data/nsi"
dst: "nsi"

View file

@ -9,17 +9,11 @@ jobs:
runs-on: [ lain ]
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
- uses: ./.forgejo/setup
- name: Init all dependencies and layers
shell: bash
run: npm ci && npm run init
run: npm run init
- name: Create export script
shell: bash