-
Notifications
You must be signed in to change notification settings - Fork 4
63 lines (52 loc) · 1.73 KB
/
bench.yml
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Update LLM Benchmark Data
on:
schedule:
# Runs at 08:00 UTC every day
- cron: '0 8 * * *'
workflow_dispatch:
jobs:
run-benchmarks:
runs-on: ubuntu-latest
steps:
- name: Send Benchmark Requests
run: |
regions=("sea" "iad" "cdg")
for region in "${regions[@]}"
do
curl -X POST 'https://ai-benchmarks.fly.dev/bench?mode=text&max_tokens=20&store=true' -H "fly-prefer-region: $region"
done
generate-latest-data:
needs: run-benchmarks
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: "20"
- name: Get data and update file
run: |
TEMP_FILE="/tmp/$(date +%s).tmp"
OUTPUT="$(node ./utils/GenerateLatestData.js 2>$TEMP_FILE)"
if [[ -f "$TEMP_FILE" ]]; then
# Read the file contents and echo them so they are captured by the GitHub Actions runner
while read -r line; do
echo "$line"
done < "$TEMP_FILE"
# Delete the file
rm "$TEMP_FILE"
exit 1
elif [ -n "$OUTPUT" ]; then
echo "$OUTPUT" > ./website/public/data/latest.json
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add ./website/public/data/latest.json
git commit -m "Update latest data"
git push
else
echo "No data generated, skipping Git operations."
fi
build-and-deploy-site:
needs: generate-latest-data
uses: ./.github/workflows/astro.yml