-
Notifications
You must be signed in to change notification settings - Fork 264
38 lines (32 loc) · 1.14 KB
/
man.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: Manual
on:
push:
paths:
- 'man/**'
jobs:
man:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Dependency
run: sudo apt install mandoc
- name: Manual generation
run: |
make man
wget -O - https://mandoc.bsd.lv/snapshots/mandoc-1.14.6.tar.gz | tar -zxC man --strip-components 1 mandoc-1.14.6/mandoc.css
- name: Upload
env:
DEPLOY_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git clone --depth=1 --single-branch --branch gh-pages "https://x-access-token:${DEPLOY_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" /tmp/gh-pages
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
mkdir -p /tmp/gh-pages/man
cp -av /tmp/gh-pages/man/index.html man/
rm -f /tmp/gh-pages/man/*
cp -av man/*.html /tmp/gh-pages/man/
cp -av man/*.css /tmp/gh-pages/man/
cd /tmp/gh-pages
git add -A && git commit --allow-empty -am "Publishing from ${GITHUB_REPOSITORY} ${GITHUB_SHA}"
git push origin gh-pages