-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (74 loc) · 2.69 KB
/
docs.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: docs
on:
push:
branches:
- 'main'
- 'dev*'
paths:
- 'knotty/scribblings/**'
- '.github/workflows/docs.yml'
permissions:
contents: write
defaults:
run:
shell: bash
jobs:
deploy-docs:
runs-on: ubuntu-latest
name: Build and deploy backup docs
steps:
- name: Checkout
uses: actions/checkout@master
- name: Install Racket
uses: Bogdanp/[email protected]
with:
architecture: 'x64'
distribution: 'full'
version: 'stable'
- name: Save Racket version
run : racket --version > .racket-version
- name: Install dependencies
run: |
echo "installing dependencies"
raco pkg install --auto --batch --no-docs --skip-installed \
sweet-exp-lib threading-lib brag-lib br-parser-tools \
sxml html-template html-parsing \
mock mock-rackunit
- name: (Re)install knotty from source
run: |
pkgs=$(raco pkg show | grep '^ [^[]' | grep -v '^ Package' | cut -d ' ' -f2)
echo "packages:" $pkgs
if [ $(echo $pkgs | grep -cw knotty-lib) -gt 0 ]
then
echo "updating knotty-lib"
raco pkg update --auto --batch --no-docs --force --type dir knotty-lib
else
echo "installing knotty-lib"
raco pkg install --auto --batch --no-docs --force --type dir knotty-lib
fi
if [ $(echo $pkgs | grep -cw knotty) -gt 0 ]
then
echo "updating knotty"
raco pkg update --auto --batch --no-docs --force --type dir knotty
else
echo "installing knotty"
raco pkg install --auto --batch --no-docs --force --type dir knotty
fi
- name: Build docs for hosting
run: |
mkdir -p manual/knotty/example/css
mkdir -p manual/knotty/example/js
mkdir -p manual/knotty/example/icon
scribble +m --redirect-main http://pkg-build.racket-lang.org/doc/ --htmls --dest manual knotty/scribblings/knotty.scrbl
cp knotty/scribblings/example/index.html manual/knotty/example/
cp knotty/scribblings/example/lattice.png manual/knotty/example/
cp knotty-lib/resources/css/knotty*.css manual/knotty/example/css/
cp knotty-lib/resources/js/knotty*.js manual/knotty/example/js/
cp knotty-lib/resources/icon/favicon.ico manual/knotty/example/icon/
#cp -R knotty/scribblings/leaf-chart/ manual/knotty
ls -R manual
- name: Push to GitHub Pages
uses: JamesIves/[email protected]
with:
folder: 'manual/knotty'
branch: 'pages'