-
Notifications
You must be signed in to change notification settings - Fork 4
60 lines (49 loc) · 1.65 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
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: |
OUTPUT=$(node ./utils/GenerateLatestData.js) || { echo "Failed to generate latest data."; exit 1; }
if [ -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."
exit 1
fi
- name: Get commit hash
id: commit_hash
run: echo "::set-output name=hash::$(git rev-parse HEAD)"
build-and-deploy-site:
needs: generate-latest-data
uses: ./.github/workflows/astro.yml
with:
commit-sha: ${{ needs.generate-latest-data.outputs.commit_hash.hash }}