mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-11 10:21:02 +01:00
44 lines
1.3 KiB
YAML
44 lines
1.3 KiB
YAML
name: Generate Stargazer Map
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
schedule:
|
|
- cron: '0 0 * * 0' # weekly
|
|
|
|
jobs:
|
|
generate-map:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.11'
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y gdal-bin
|
|
pip install requests pandas geopandas matplotlib pycountry geopy
|
|
|
|
- name: Download shapefile
|
|
run: |
|
|
wget https://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/cultural/ne_110m_admin_0_countries.zip
|
|
unzip -o ne_110m_admin_0_countries.zip
|
|
|
|
- name: Run script
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
REPO: alexbelgium/hassio-addons
|
|
run: python .github/generate_stargazer_map.py
|
|
|
|
- name: Commit and push CSV and PNG
|
|
run: |
|
|
git config --global user.name "github-actions[bot]"
|
|
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
git add stargazers_countries.csv stargazer_map.png
|
|
git commit -m "Update stargazer map and countries CSV" || echo "No changes to commit"
|
|
git push --force
|