Skip to content

Update API files

Update API files #1632

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: Update API files
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
schedule:
- cron: '0 0 * * *'
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
# Runs a single command using the runners shell
- name: Install dependencies
run: pip3 install setuptools
- name: Install the updater
run: sudo pip3 install ./pyAPIUpdater/
- name: Update the json files
run: |
for i in *.json; do
[ -f "$i" ] || break
apiupdater -filename $i -url https://map.freifunk-suedholstein.de/data/meshviewer.json
done
- name: Update repository
run: |
git remote add github "https://$GITHUB_ACTOR:[email protected]/$GITHUB_REPOSITORY.git"
git pull github ${GITHUB_REF} --ff-only
git add .
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git commit -m "Update node count"
git push github HEAD:${GITHUB_REF}