This repository was archived by the owner on May 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
47 lines (43 loc) · 1.58 KB
/
Copy pathpublish-docs.yml
File metadata and controls
47 lines (43 loc) · 1.58 KB
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
39
40
41
42
43
44
45
46
47
name: Publish docs
on:
push:
branches:
- master
schedule:
- cron: '0 6 * * *'
workflow_dispatch:
jobs:
publish-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: generate appslist
run: |
rm -rf ./pi-apps*/
git config user.name 'Ryan Fortner'
git config user.email 'ryanfortner@users.noreply.github.com'
git clone https://github.com/Botspot/pi-apps.wiki.git
export version=$(bash -c 'git rev-parse HEAD | cut -c 1-8')
export current=$(cat appslist-commit.txt)
[ "$current" == "$version" ] && exit 0
rm -f ./docs/apps-list.md
cat ./pi-apps.wiki/Apps-List.md >> ./docs/apps-list.md
rm -rf ./pi-apps.wiki/
sed -i 's/blob/raw/' ./docs/apps-list.md
sed -i 's/icon-64/icon-24/' ./docs/apps-list.md
sed -i 's/^# /## /' ./docs/apps-list.md
sed -i '1i # Apps List' ./docs/apps-list.md
#replace $website to <website>
for line in $(awk '/###/{getline; print}' ./docs/apps-list.md | awk '{print $1;}' | grep http --color=none | sed 's/<br//g'); do
sed -i -z "s+$line+<$line>+" ./docs/apps-list.md
done
echo $version > appslist-commit.txt
git add .
git commit -m "[auto] update appslist"
git push origin master
- name: deploy docs
uses: mhausenblas/mkdocs-deploy-gh-pages@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CONFIG_FILE: mkdocs.yml
EXTRA_PACKAGES: build-base