Compare commits
3 commits
3942d2e2f8
...
a58bd13088
| Author | SHA1 | Date | |
|---|---|---|---|
| a58bd13088 | |||
| db54007fd4 | |||
| 32f5771918 |
3 changed files with 56 additions and 0 deletions
27
.forgejo/workflows/wow.yml
Normal file
27
.forgejo/workflows/wow.yml
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
# .forgejo/workflows/wow.yml
|
||||||
|
name: "Generate commit words of wisdom"
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: ["main"]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: "docker"
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: "Check out repository"
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: "Generate website"
|
||||||
|
run: ./gsite.sh
|
||||||
|
|
||||||
|
- name: "Show generated page"
|
||||||
|
run: cat public/index.html
|
||||||
|
|
||||||
|
- name: "Upload website artifact"
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: "commit-fortune-site"
|
||||||
|
path: public/
|
||||||
24
gsite.sh
Executable file
24
gsite.sh
Executable file
|
|
@ -0,0 +1,24 @@
|
||||||
|
#!/bin/bash
|
||||||
|
set -euo pipefall
|
||||||
|
|
||||||
|
wow=$(shuf -n 1 wow.txt)
|
||||||
|
commit_message=$(git log -1 --pretty=%s)
|
||||||
|
date=$(date --iso-8601=seconds)
|
||||||
|
|
||||||
|
mkdir -p public
|
||||||
|
|
||||||
|
cat > public/index.html <<EOF
|
||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Commit words of wisdom</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Commit words of wisdom</h1>
|
||||||
|
<p><strong>${wow}</strong></p>
|
||||||
|
<p>Latest commit: ${commit_message}</p>
|
||||||
|
<p>Generated: ${date}</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
EOF
|
||||||
5
wow.txt
Normal file
5
wow.txt
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
Life is a hopeless endeavour.
|
||||||
|
What remains in world void of desires?
|
||||||
|
Dullness comes close to bliss.
|
||||||
|
Actions are merely actions.
|
||||||
|
Among us shrubs only shrubs exist.
|
||||||
Loading…
Add table
Add a link
Reference in a new issue