Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,35 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- uses: actions/setup-python@v5

- name: Install Python
uses: actions/setup-python@v5
with:
python-version: 3.x
python-version-file: "pyproject.toml"

- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: "0.8.17"
enable-cache: true

- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV

- uses: actions/cache@v4
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-

- run: |
wget https://raw.githubusercontent.com/open-energy-transition/Awesome-Electric-Grid-Mapping/main/README.md -O- | \
sed '1s/^#.*/<div class="page-headers">\n 🗺️ Curated Grid Maps\n\n<a href="https:\/\/github.com\/open-energy-transition\/Awesome-Electric-Grid-Mapping" class="github-link">🔗 View on GitHub<\/a>\n<\/div>\n/' > ./docs/awesome.md
- run: pip install mkdocs-material mkdocs-glightbox mkdocs-static-i18n
- run: mkdocs gh-deploy --force

- run: uv run mkdocs gh-deploy --force

15 changes: 9 additions & 6 deletions .github/workflows/update-community-stats.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,21 @@ jobs:
- name: checkout repo
uses: actions/checkout@v4

- name: 🐍 Set up Python
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: 📦 Install Python dependencies
run: pip install requests aiohttp
python-version-file: "pyproject.toml"

- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: "0.8.17"
enable-cache: true

- name: 🚀 Run stats script for weekly update
env:
OSMCHA_TOKEN: ${{ secrets.OSMCHA_TOKEN }}
run: python docs/py-scripts/update_community_stats.py --mode weekly
run: uv run python docs/py-scripts/update_community_stats.py --mode weekly

- name: ⬆️ Upload JSON to Release
uses: softprops/action-gh-release@v2
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/update-line-length.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,20 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: 🐍 Set up Python

- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: 📦 Install Python dependencies
run: pip install requests beautifulsoup4
python-version-file: "pyproject.toml"

- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: "0.8.17"
enable-cache: true

- name: 🚀 Run line length calculation script
run: python docs/py-scripts/line-length.py
run: uv run python docs/py-scripts/line-length.py

- name: ⬆️ Upload JSON to Release
uses: softprops/action-gh-release@v2
Expand Down
15 changes: 9 additions & 6 deletions .github/workflows/update-power.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@ jobs:
- name: 🛎️ Checkout repository
uses: actions/checkout@v4

- name: 🐍 Set up Python
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: 📦 Install Python dependencies
run: pip install requests
python-version-file: "pyproject.toml"

- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: "0.8.17"
enable-cache: true

- name: 🔍 Debug - Check files exist
run: |
Expand All @@ -35,7 +38,7 @@ jobs:
timeout-minutes: 25 # Set timeout for just this step
run: |
echo "Starting Python script execution at $(date)"
python docs/py-scripts/power-ways.py
uv run python docs/py-scripts/power-ways.py
echo "Python script completed at $(date)"

- name: ⬆️ Upload JSON to Release
Expand Down
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ When you make an edit, please use the **#MapYourGrid** in the changeset to help

## Contribute to this website

1. Install mkdocs material on your machine:
```bash
pip install mkdocs-material mkdocs-glightbox
```
1. [Install uv](https://docs.astral.sh/uv/getting-started/installation/) on your machine

2. Clone this repository our your fork of this repository:
```bash
Expand All @@ -43,7 +40,7 @@ git checkout -b "your-branch-name"
5. Run the website on your machine:
```bash
cd MapYourGrid
mkdocs serve
uv run mkdocs serve
```

6. Open http://127.0.0.1:8000/ in your browser to see your changes. If you change a file, the website is automatically recreated.
Expand Down
15 changes: 15 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[project]
name = "mapyourgrid-website"
version = "0.1.0"
description = "MapYourGrid Website"
readme = "README.md"
requires-python = ">=3.13"
dependencies = [
"aiohttp>=3.12.15",
"beautifulsoup4>=4.13.5",
"mkdocs>=1.6.1",
"mkdocs-glightbox>=0.5.1",
"mkdocs-material>=9.6.20",
"mkdocs-static-i18n>=1.3.0",
"requests>=2.32.5",
]
Loading