Skip to content

Commit

Permalink
workflows: add a independent workflow for wikiupdater
Browse files Browse the repository at this point in the history
  • Loading branch information
FFHener authored and Noki committed Feb 10, 2024
1 parent 0cf2b69 commit bbed279
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/testbuild.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Test Build
on: [pull_request] # yamllint disable-line rule:truthy
on: [pull_request] # yamllint disable-line rule:truthy

jobs:
build:
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/wikiupdate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: Wikiupdate
on: # yamllint disable-line rule:truthy
push:
branches:
- master

jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install dependencies
run: sudo apt install python3

- name: Install dependencies
run: pip3 install -r requirements.txt --upgrade pip

- name: Determine changed locations
run: |
CHANGED_LOCATIONS=$(git diff ${{ github.event.before }}..${{ github.event.after }} --diff-filter=d --name-only | grep 'locations/' | sed 's/locations\/\(.*\)\.yml/location_\1/' | sed -z 's/-/_/g;s/\n/,/g;s/,$//')
echo "Updating for changed locations: $CHANGED_LOCATIONS"
echo "CHANGED_LOCATIONS=$CHANGED_LOCATIONS" >> "$GITHUB_ENV"
- name: Update wiki.freifunk.net
run: |
if [ -n "${CHANGED_LOCATIONS}" ]; then
ansible-playbook play.yml --tags wiki --limit "$CHANGED_LOCATIONS" ||true
else
echo "No locations were changed. Skipping update"
fi

0 comments on commit bbed279

Please sign in to comment.