File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3333 - name : Setup Pages
3434 uses : actions/configure-pages@v5
3535
36+ - name : Compute build metadata
37+ id : meta
38+ run : |
39+ echo "short_sha=$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_OUTPUT
40+ echo "timestamp=$(TZ=Europe/Zurich date '+%Y-%m-%d %H:%M %Z')" >> $GITHUB_OUTPUT
41+
42+ - name : Inject build info into about.html
43+ uses : cschleiden/replace-tokens@v1
44+ with :
45+ files : ' ["about.html"]'
46+ env :
47+ SHORT_SHA : ${{ steps.meta.outputs.short_sha }}
48+ TIMESTAMP : ${{ steps.meta.outputs.timestamp }}
49+
3650 - name : Upload artifact
3751 uses : actions/upload-pages-artifact@v4
3852 with :
Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html lang ="fr ">
3+ < head >
4+ < meta charset ="UTF-8 ">
5+ < meta name ="viewport " content ="width=device-width, initial-scale=1 ">
6+ < title > À propos — Morpion</ title >
7+ < link href ="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css " rel ="stylesheet ">
8+ </ head >
9+ < body class ="bg-light ">
10+ < div class ="container py-4 " style ="max-width: 480px ">
11+ < h1 class ="mb-4 "> À propos</ h1 >
12+ < dl class ="row ">
13+ < dt class ="col-4 "> Dépôt</ dt >
14+ < dd class ="col-8 font-monospace "> < a href ="https://github.com/#{GITHUB_REPOSITORY}# "> #{GITHUB_REPOSITORY}#</ a > </ dd >
15+ < dt class ="col-4 "> Branche</ dt >
16+ < dd class ="col-8 font-monospace "> #{GITHUB_REF_NAME}#</ dd >
17+ < dt class ="col-4 "> Commit</ dt >
18+ < dd class ="col-8 font-monospace "> < a href ="https://github.com/#{GITHUB_REPOSITORY}#/commit/#{SHORT_SHA}# "> #{SHORT_SHA}#</ a > </ dd >
19+ < dt class ="col-4 "> Construit le</ dt >
20+ < dd class ="col-8 font-monospace "> #{TIMESTAMP}#</ dd >
21+ </ dl >
22+ </ div >
23+ </ body >
24+ </ html >
You can’t perform that action at this time.
0 commit comments