k9: small changes / enable local mesh #234
This file contains 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
--- | |
name: Wikiupdate | |
on: # yamllint disable-line rule:truthy | |
push: | |
branches: | |
- main | |
jobs: | |
update_wiki: | |
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 | |
env: | |
FF_WIKI_USER: ${{ vars.FF_WIKI_USER }} | |
FF_WIKI_PASSWORD: ${{ secrets.FF_WIKI_PASSWORD }} | |
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 |