forked from SerenityOS/serenity
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Meta: Add workflow that deploys man page updates to man.serenityos.org
- Loading branch information
1 parent
04c3cdd
commit d29e2dd
Showing
3 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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/[email protected] | ||
with: | ||
git-config-name: BuggieBot | ||
git-config-email: [email protected] | ||
branch: master | ||
repository-name: SerenityOS/manpages-website | ||
token: ${{ secrets.BUGGIEBOT }} | ||
folder: output |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |