-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (31 loc) · 952 Bytes
/
badge.yml
File metadata and controls
37 lines (31 loc) · 952 Bytes
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
name: Generate Score Badge
on:
push:
branches: [main]
paths:
- 'results.log'
jobs:
generate-badge:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Extract best score
id: extract-score
run: |
BEST_SCORE=$(head -1 results.log | grep -oP '\d+\.\d+')
echo "score=$BEST_SCORE" >> $GITHUB_OUTPUT
- name: Create badge JSON
run: |
echo '{"schemaVersion": 1, "label": "Best Score", "message": "${{ steps.extract-score.outputs.score }}", "color": "blue"}' > badge.json
- name: Upload badge
uses: actions/upload-artifact@v4
with:
name: score-badge
path: badge.json
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: .
publish_branch: gh-pages
keep_files: true