37 lines
884 B
YAML
37 lines
884 B
YAML
name: Generate Power Graph
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
paths:
|
|
- power_log.csv
|
|
|
|
jobs:
|
|
plot:
|
|
runs-on: [self-hosted]
|
|
env:
|
|
BRANCH: ${{ github.ref_name }}
|
|
COMMIT: ${{ github.sha }}
|
|
steps:
|
|
- 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)"
|
|
|
|
- name: Install Python dependencies
|
|
run: |
|
|
sudo apt update
|
|
sudo apt install -y python3 python3-pip
|
|
pip3 install matplotlib pandas
|
|
|
|
- name: Generate power graph
|
|
run: |
|
|
python3 plot_power.py
|
|
|
|
- name: Upload graph artifact
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: power-graph
|
|
path: power_graph.png
|
|
|