mirror of
https://github.com/permissionlesstech/georelays.git
synced 2026-07-24 22:45:18 +00:00
add automated relay count tracking with dual trend charts (#8)
* Add relay count tracking workflow with dual charts This commit adds: - New GitHub workflow to track relay counts - Two charts: BitChat-compatible relays and total functioning relays - Extended history for both charts (70 days) - Project structure improvements with scripts and assets directories - Updated documentation in README.md and other files - Dependencies in requirements.txt * Remove overlapping data point labels from relay count charts * Add .venv to gitignore * Add relay location maps and automation workflow * Improve relay maps with proper world map backgrounds using cartopy * Add relay location map to README * update readme
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
name: Track Relay Count Changes
|
||||
|
||||
on:
|
||||
# Run after the "Update Relay Data" workflow completes
|
||||
workflow_run:
|
||||
workflows: ["Update Relay Data"]
|
||||
types:
|
||||
- completed
|
||||
# Also allow manual triggering
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
track-relay-count:
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 100 # Need deeper history to check previous commits (70+ days)
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.x'
|
||||
|
||||
- name: Install Python dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
# Check if requirements.txt includes matplotlib, pandas, numpy
|
||||
if ! grep -q "matplotlib\|pandas\|numpy" requirements.txt; then
|
||||
# If not, install them directly
|
||||
pip install matplotlib pandas numpy
|
||||
else
|
||||
# Otherwise use the requirements file
|
||||
pip install -r requirements.txt
|
||||
fi
|
||||
|
||||
- name: Track relay count changes
|
||||
run: |
|
||||
mkdir -p assets
|
||||
|
||||
# Execute the script
|
||||
python scripts/track_relay_counts.py
|
||||
|
||||
- name: Check for changes
|
||||
id: git-check
|
||||
run: |
|
||||
git add assets/bitchat_relay_count_chart.png assets/total_relay_count_chart.png
|
||||
git diff --staged --exit-code || echo "changes=true" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Commit and push changes
|
||||
if: steps.git-check.outputs.changes == 'true'
|
||||
run: |
|
||||
git config --local user.email "action@github.com"
|
||||
git config --local user.name "GitHub Action"
|
||||
git commit -m "Update relay count charts - $(date -u)"
|
||||
git push
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -0,0 +1,61 @@
|
||||
name: Update Relay Maps
|
||||
|
||||
on:
|
||||
# Run after the "Update Relay Data" workflow completes
|
||||
workflow_run:
|
||||
workflows: ["Update Relay Data"]
|
||||
types:
|
||||
- completed
|
||||
# Also allow manual triggering
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
update-relay-maps:
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 100 # Need deeper history
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.x'
|
||||
|
||||
- name: Install Python dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install matplotlib pandas numpy folium scipy
|
||||
# Install cartopy and its dependencies
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libproj-dev proj-bin proj-data libgeos-dev
|
||||
pip install cartopy
|
||||
|
||||
- name: Generate relay maps
|
||||
run: |
|
||||
mkdir -p assets
|
||||
|
||||
# Execute the script
|
||||
python scripts/generate_relay_map.py
|
||||
|
||||
- name: Check for changes
|
||||
id: git-check
|
||||
run: |
|
||||
git add assets/relay_locations_static.png assets/relay_locations_heatmap.png assets/relay_locations_interactive.html
|
||||
git diff --staged --exit-code || echo "changes=true" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Commit and push changes
|
||||
if: steps.git-check.outputs.changes == 'true'
|
||||
run: |
|
||||
git config --local user.email "action@github.com"
|
||||
git config --local user.name "GitHub Action"
|
||||
git commit -m "Update relay location maps - $(date -u)"
|
||||
git push
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
Reference in New Issue
Block a user