Meta: Add workflow that deploys man page updates to man.serenityos.org
This commit is contained in:
parent
04c3cddb1e
commit
d29e2dd2d7
Notes:
sideshowbarker
2024-07-18 18:43:11 +09:00
Author: https://github.com/IdanHo Commit: https://github.com/SerenityOS/serenity/commit/d29e2dd2d7b Pull-request: https://github.com/SerenityOS/serenity/pull/6859
3 changed files with 71 additions and 0 deletions
53
.github/workflows/manpages.yml
vendored
Normal file
53
.github/workflows/manpages.yml
vendored
Normal file
|
@ -0,0 +1,53 @@
|
|||
name: Generate man pages
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- "Base/usr/share/man/**"
|
||||
|
||||
env:
|
||||
MAN_DIR: ${{ github.workspace }}/Base/usr/share/man/
|
||||
|
||||
jobs:
|
||||
convert_using_pandoc:
|
||||
runs-on: ubuntu-20.04
|
||||
if: always() && github.repository == 'SerenityOS/serenity' && github.ref == 'refs/heads/master'
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: r-lib/actions/setup-pandoc@v1
|
||||
with:
|
||||
pandoc-version: '2.13'
|
||||
- name: Prepare output directories
|
||||
run: |
|
||||
for d in $MAN_DIR*/; do
|
||||
mkdir -p output/$(basename "$d")
|
||||
done
|
||||
- name: Convert markdown to html
|
||||
run: |
|
||||
find $MAN_DIR -iname '*.md' -type f -exec sh -c 'relative=$(realpath --relative-to=$MAN_DIR $0) && pandoc -f gfm -t html5 -s -o output/${relative%.md}.html ${0}' {} \;
|
||||
- name: Generate man page listings
|
||||
run: |
|
||||
for d in output/*/; do
|
||||
dir_name=$(basename "$d")
|
||||
echo "<!DOCTYPE html><html><head><title>$dir_name</title></head><body>" > "$d/index.html"
|
||||
for f in $d/*; do
|
||||
file_name=$(basename "$f")
|
||||
if [[ "$file_name" == "index.html" ]]; then
|
||||
continue
|
||||
fi
|
||||
echo "<a href=\"$file_name\"><p>${file_name%.html}</p></a>" >> "$d/index.html"
|
||||
done
|
||||
echo "</body></html>" >> "$d/index.html"
|
||||
done
|
||||
- name: Copy pre-made files
|
||||
run: |
|
||||
cp -R Meta/Websites/man.serenityos.org/* output/
|
||||
- name: Deploy to github pages
|
||||
uses: JamesIves/github-pages-deploy-action@4.1.1
|
||||
with:
|
||||
git-config-name: BuggieBot
|
||||
git-config-email: buggiebot@serenityos.org
|
||||
branch: master
|
||||
repository-name: SerenityOS/manpages-website
|
||||
token: ${{ secrets.BUGGIEBOT }}
|
||||
folder: output
|
BIN
Meta/Websites/man.serenityos.org/banner.png
Normal file
BIN
Meta/Websites/man.serenityos.org/banner.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 49 KiB |
18
Meta/Websites/man.serenityos.org/index.html
Normal file
18
Meta/Websites/man.serenityos.org/index.html
Normal file
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>SerenityOS man pages</title>
|
||||
</head>
|
||||
<body>
|
||||
<img src="banner.png" alt="SerenityOS">
|
||||
<h1>SerenityOS man pages</h1>
|
||||
<a href="man1/"><p>Man 1</p></a>
|
||||
<a href="man1/"><p>Man 2</p></a>
|
||||
<a href="man1/"><p>Man 3</p></a>
|
||||
<a href="man1/"><p>Man 4</p></a>
|
||||
<a href="man1/"><p>Man 5</p></a>
|
||||
<a href="man1/"><p>Man 6</p></a>
|
||||
<a href="man1/"><p>Man 7</p></a>
|
||||
<a href="man1/"><p>Man 8</p></a>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Reference in a new issue