amd-monitor/.forgejo/workflows/power-graph.yml

39 lines
1,008 B
YAML
Raw Normal View History

2025-11-05 17:45:27 -05:00
name: Generate Power Graph
on:
push:
branches: [ master ]
paths: [ power_log.csv ]
2025-11-05 17:45:27 -05:00
jobs:
plot:
runs-on: [self-hosted]
2025-11-05 18:17:37 -05:00
env:
BRANCH: ${{ github.ref_name }}
COMMIT: ${{ github.sha }}
2025-11-05 17:45:27 -05:00
steps:
2025-11-05 18:17:37 -05:00
- name: Clone repository manually
run: |
git clone --branch "$BRANCH" https://${{ secrets.PAT_READ_REPO }}@mentalnet.xyz/forgejo/markmental/amd-monitor.git .
echo "✅ Checked out branch $BRANCH ($COMMIT)"
2025-11-05 17:45:27 -05:00
- name: Install Python and deps (venv)
2025-11-05 17:45:27 -05:00
run: |
apt-get update
apt-get install -y python3-full python3-venv
python3 -m venv venv
. venv/bin/activate
pip install --upgrade pip
pip install matplotlib pandas
2025-11-05 17:45:27 -05:00
- name: Generate power graph
run: |
. venv/bin/activate
python plot_power.py
2025-11-05 17:45:27 -05:00
- name: Upload graph artifact
2025-11-05 18:17:37 -05:00
uses: actions/upload-artifact@v3
2025-11-05 17:45:27 -05:00
with:
name: power-graph
path: power_graph.png