-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (36 loc) · 1.28 KB
/
main.yml
File metadata and controls
44 lines (36 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Generate D2 Diagrams
on:
push:
paths:
- 'Elektronik/Wiring_Plan/**.d2'
- 'scripts/generate_diagrams.py'
- 'platformio.ini'
workflow_dispatch: # Erlaubt das manuelle Starten unter "Actions"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install D2
run: |
curl -fsSL https://d2lang.com/install.sh | sh -s --
# Prüfen ob D2 im Path ist
d2 --version
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install platformio
- name: Generate Diagrams via PIO
run: pio run -t generate_docs
- name: Commit and Push changes
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add Elektronik/Wiring_Plan/*.svg Elektronik/Wiring_Plan/*.png
# Nur committen, wenn es Änderungen gibt, um Fehler zu vermeiden
git diff --quiet && git diff --staged --quiet || (git commit -m "docs: auto-generate diagrams [skip ci]" && git push)