-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathaction.yml
78 lines (77 loc) · 2.53 KB
/
action.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
75
76
77
78
name: 'Compile Documentation'
description: 'Compile documentation with Staple'
branding:
color: blue
icon: file-text
inputs:
project:
description: 'The project to compile documentation for'
output:
description: 'Where to put the documentation output'
template:
description: 'The Clip template to use for documentation pages'
gh-pages:
description: 'If set will publish the documentation to Github Pages'
dist:
descriptino: 'An extra dist to load for dependencies'
outputs:
output:
description: 'The output directory into which the documentation was put'
value: ${{ inputs.output }}
runs:
using: "composite"
steps:
- name: Restore cache
uses: actions/cache@v3
id: cache
with:
path: |
~/.quicklisp
~/.cache/common-lisp
~/AppData/Local/cache
key: staple-${{ runner.os }}
- name: Install Lisp
shell: bash
run: |
sudo apt-get install -yy sbcl
- name: Install env
if: steps.cache.outputs.cache-hit != 'true'
shell: bash
run: |
curl https://beta.quicklisp.org/quicklisp.lisp \
| cat - <(echo "(quicklisp-quickstart:install :path \"~/.quicklisp/\")" \
"(when (< 0 (length \"$DIST\")) (ql-dist:install-dist \"$DIST\" :prompt NIL))" \
"(ql:quickload :staple/standalone :silent T)") \
| sbcl --noinform
env:
DIST: ${{ inputs.dist }}
- uses: actions/checkout@v4
with:
repository: shinmera/staple
path: staple
- name: Run staple
shell: bash
run: |
sbcl --noinform \
--eval "(load \"~/.quicklisp/setup.lisp\")" \
--eval "(push \"$GITHUB_WORKSPACE\" ql:*local-project-directories*)" \
--eval "(ql:quickload :staple/standalone :silent T)" \
--eval "(staple::main)" \
--quit --end-toplevel-options \
"$PROJECT" \
--output "$OUTPUT" \
--template "$TEMPLATE"
env:
PROJECT: ${{ inputs.project || github.event.repository.name }}
OUTPUT: ${{ inputs.output || format('{0}/staple-output/', runner.temp) }}
TEMPLATE: ${{ inputs.template }}
LISP: sbcl-bin
- name: Upload Github Pages Artefact
if: ${{ inputs.gh-pages }}
uses: actions/upload-pages-artifact@v3.0.1
with:
path: ${{ inputs.output || format('{0}/staple-output/', runner.temp) }}
- name: Write to Github Pages
if: ${{ inputs.gh-pages }}
id: deployment
uses: actions/deploy-pages@v4