Skip to content

Commit e6009dd

Browse files
authored
Merge pull request #118 from kup6s/issue-116-docs-version-footer
feat: add version and build date to documentation footer
2 parents cd67b70 + 7b35eb0 commit e6009dd

File tree

4 files changed

+28
-0
lines changed

4 files changed

+28
-0
lines changed

.github/workflows/docs.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ on:
55
branches: [main]
66
paths:
77
- 'docs/**'
8+
- 'charts/kup6s-pages/Chart.yaml'
89
- '.github/workflows/docs.yaml'
10+
workflow_dispatch:
911

1012
jobs:
1113
build-and-deploy:
@@ -21,6 +23,16 @@ jobs:
2123
hugo-version: 'latest'
2224
extended: true
2325

26+
- name: Generate build info
27+
run: |
28+
VERSION=$(grep '^version:' charts/kup6s-pages/Chart.yaml | awk '{print $2}')
29+
BUILD_DATE=$(date -u +'%Y-%m-%d')
30+
mkdir -p docs/data
31+
cat > docs/data/build.yaml << EOF
32+
version: "${VERSION}"
33+
date: "${BUILD_DATE}"
34+
EOF
35+
2436
- name: Build docs
2537
run: hugo --source docs --minify
2638

.github/workflows/release.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ jobs:
6969
runs-on: ubuntu-latest
7070
needs: test
7171
permissions:
72+
actions: write
7273
contents: write
7374
packages: write
7475
steps:
@@ -110,3 +111,8 @@ jobs:
110111
git add charts/kup6s-pages/Chart.yaml
111112
git commit -m "chore: bump Chart.yaml to ${{ steps.version.outputs.version }} [skip ci]"
112113
git push origin main
114+
115+
- name: Trigger docs rebuild
116+
run: gh workflow run docs.yaml
117+
env:
118+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

docs/.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Hugo build output
2+
public/
3+
resources/
4+
5+
# Generated at build time
6+
data/build.yaml
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<hr />
2+
<p style="text-align: center; font-size: 0.85em; color: var(--gray-500);">
3+
{{ with .Site.Data.build }}Version {{ .version }} | Built {{ .date }}{{ end }}
4+
</p>

0 commit comments

Comments
 (0)