-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (55 loc) · 1.72 KB
/
deploy.yml
File metadata and controls
62 lines (55 loc) · 1.72 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Deploy
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: run doc org
run: |
examples=$(ls -d */)
echo "$examples"
git clone https://github.com/doc-org/doc-org
mkdir deploy
for dir in $examples; do
mkdir deploy/$dir
echo "process directory "$dir""
ls "$dir"
./doc-org/doc-org "$dir"
# give current user ownership of the build directory
current_user=$(whoami)
sudo chown -R $current_user "$dir"/build
mv "$dir"/build/*.pdf "$dir"/build/*.tex deploy/$dir
done
- name: build website
run: |
echo "<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8" />
<title>Doc-Org Examples</title>
</head>
<body>
<h1>Doc-Org Examples</h1>
Examples input <a href=\"https://github.com/doc-org/examples\">here</a>. Examples output:" >> deploy/index.html
for dir in deploy/*/; do
dir_basename=$(basename "$dir")
echo "<h2>"$dir_basename"</h1>
<ul>" >> deploy/index.html
# for each file in the directory
ls -1 "$dir" | while read file ; do
echo " <li><a href=\""$dir_basename"/"$file"\">"$file"</a></li>" >> deploy/index.html
done
echo " </ul>" >> deploy/index.html
done
echo "</body></html>" >> deploy/index.html
- name: Deploy to gh-pages
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
publish_dir: ./deploy
publish_branch: gh-pages
emptyCommits: false