-
Notifications
You must be signed in to change notification settings - Fork 14
/
action.yml
92 lines (82 loc) · 2.92 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: 'Logseq Publish SPA'
description: 'Publishes a Logseq graph as a Single Page Application (SPA)'
inputs:
graph-directory:
description: "Graph's root directory"
required: true
default: '.'
output-directory:
description: "Directory for published graph"
required: true
default: 'www'
version:
description: "Frontend version of Logseq - git tag or SHA"
required: true
default: '0.10.6'
theme-mode:
description: "Theme mode of frontend. Can be 'dark' or 'light'"
required: false
default: 'light'
accent-color:
description: "Accent color of frontend. 10+ colors available."
required: false
default: 'blue'
runs:
using: "composite"
steps:
# First, build logseq's static/ and publishing assets
- name: Checkout logseq
uses: actions/checkout@v4
with:
repository: logseq/logseq
path: .logseq-logseq
ref: ${{ inputs.version }}
## Placed here since node step requires it
- name: Checkout action
uses: actions/checkout@v4
with:
repository: logseq/publish-spa
path: .logseq-publish-spa
- name: Set up Clojure
uses: DeLaGuardo/setup-clojure@master
with:
cli: 1.11.1.1182
bb: 1.2.174
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'yarn'
cache-dependency-path: .logseq-publish-spa/yarn.lock
- name: Logseq static cache
uses: actions/cache@v3
id: logseq-static-all
with:
path: .logseq-logseq/static
key: ${{ runner.os }}-logseq-static-all-${{ inputs.version }}
restore-keys: ${{ runner.os }}-logseq-static-all-${{ inputs.version }}
- name: Fetch logseq's yarn deps, build static dir and build cljs publishing
if: steps.logseq-static-all.outputs.cache-hit != 'true'
run: cd .logseq-logseq && yarn install --frozen-lockfile && yarn gulp:build && clojure -M:cljs release publishing
shell: bash
# Second, checkout action and run publish script
- name: Fetch yarn deps
run: cd .logseq-publish-spa && yarn install --frozen-lockfile
shell: bash
- name: Nbb cache
uses: actions/cache@v3
id: nbb-deps
with:
path: |
~/.m2/repository
~/.gitlibs
.logseq-publish-spa/.nbb/.cache
key: ${{ runner.os }}-nbb-deps-${{ hashFiles('.logseq-publish-spa/nbb.edn') }}
restore-keys: ${{ runner.os }}-nbb-deps-
- name: Fetch nbb deps
if: steps.nbb-deps.outputs.cache-hit != 'true'
run: cd .logseq-publish-spa && yarn nbb-logseq -e ':fetching-deps'
shell: bash
- name: Export graph to directory
run: cd .logseq-publish-spa && node publish_spa.mjs ${{ inputs.output-directory }} --static-directory .logseq-logseq/static --directory ${{ inputs.graph-directory }} --theme-mode ${{ inputs.theme-mode }} --accent-color ${{ inputs.accent-color }}
shell: bash