Skip to content

Commit ec91081

Browse files
committed
gpt go
1 parent 614af07 commit ec91081

1 file changed

Lines changed: 39 additions & 59 deletions

File tree

Lines changed: 39 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,67 @@
1-
name: Process Data & Publish Plots
1+
name: Build and Deploy Plot
22

33
on:
44
push:
5-
paths:
6-
- "data/**/*.csv"
7-
- "data/**/*.parquet"
5+
branches: ["main"]
86

97
permissions:
10-
id-token: write
8+
contents: read
119
pages: write
12-
contents: write
10+
id-token: write
1311

1412
jobs:
1513
build:
1614
runs-on: ubuntu-latest
17-
steps:
18-
- name: Checkout repo
19-
uses: actions/checkout@v4
20-
21-
- name: Setup Python
22-
uses: actions/setup-python@v4
23-
with:
24-
python-version: "3.11"
2515

26-
- name: Install dependencies
27-
run: |
28-
pip install numpy pandas plotly pyarrow
29-
30-
- name: Make output directory
31-
run: mkdir -p output
32-
33-
- name: Run main.py for changed data files
34-
id: generate
35-
run: |
36-
echo "Changed files:"
37-
echo "${{ github.event.head_commit.modified }}"
38-
39-
# Detect changed CSV/parquet files
40-
changed=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -E "\.csv$|\.parquet$" || true)
16+
steps:
4117

42-
if [ -z "$changed" ]; then
43-
echo "No new data files found."
44-
exit 0
45-
fi
18+
- name: Checkout repo
19+
uses: actions/checkout@v4
4620

47-
echo "$changed" | while read file; do
48-
echo "Processing $file ..."
49-
python main.py "$file"
50-
done
21+
- name: Set up Python
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: "3.11"
5125

52-
- name: List output contents
53-
run: |
54-
echo "Output directory contains:"
55-
ls -lh output || echo "output directory missing"
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install uv
30+
uv sync
5631
57-
- name: Compress HTML files (if any)
58-
run: |
59-
shopt -s nullglob
60-
files=(output/*.html)
32+
- name: Run plotter
33+
run: |
34+
mkdir -p output
35+
python main.py data/datadump_11-6-whatisevenhappening.csv
6136
62-
if [ ${#files[@]} -eq 0 ]; then
63-
echo "No HTML files to compress."
64-
exit 0
65-
fi
37+
- name: Confirm output contents
38+
run: |
39+
echo "PWD: $(pwd)"
40+
echo "Repo contents:"
41+
ls -R .
6642
67-
for f in "${files[@]}"; do
68-
echo "Compressing $f ..."
69-
gzip -9 "$f"
70-
mv "$f.gz" "$f"
71-
done
43+
- name: Compress HTML files
44+
run: |
45+
echo "Compressing output/*..."
46+
cd output
47+
ls -l
48+
for f in *.html; do
49+
gzip -9 "$f"
50+
done
7251
73-
- name: Upload artifact for Pages
74-
uses: actions/upload-pages-artifact@v2
75-
with:
76-
path: output
52+
- name: Upload artifact for GitHub Pages
53+
uses: actions/upload-pages-artifact@v3
54+
with:
55+
path: output
7756

7857
deploy:
7958
needs: build
8059
runs-on: ubuntu-latest
8160
environment:
8261
name: github-pages
8362
url: ${{ steps.deployment.outputs.page_url }}
63+
8464
steps:
8565
- name: Deploy to GitHub Pages
8666
id: deployment
87-
uses: actions/deploy-pages@v2
67+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)