This repository has been archived by the owner on Apr 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 36
/
action.yml
55 lines (55 loc) · 1.6 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
name: "Logseq Publish"
description: "Publish your Logseq Graph"
inputs:
src:
description: "export source"
required: true
default: ""
dest:
description: "export destination"
required: true
default: "www"
version:
description: >
Logseq version to use. Note, not all version are supported.
Use "latest" if you are not sure what to put here.
required: true
default: "latest"
trace:
required: false
description: >
Whether or not to generate trace file for debugging.
default: "true"
theme:
description: "selected theme"
required: true
default: "light"
branding:
icon: "arrow-up-circle"
color: "green"
runs:
using: "composite"
steps:
- name: Create dest before running docker
shell: bash
run: mkdir -p ${{ github.workspace }}/${{ inputs.dest }}
- uses: addnab/docker-run-action@v3
with:
image: "ghcr.io/pengx17/logseq-publish:${{ inputs.version }}"
options: |
-v ${{ github.workspace }}:/home/logseq/graph
run: |
xvfb-run node publish.mjs -p graph/${{ inputs.src }} -t ${{ inputs.trace }} -o graph/${{ inputs.dest }} --theme ${{ inputs.theme }}
exit $?
- name: change exported files owner
shell: bash
run: |
sudo chown -R $USER: ${{ github.workspace }}/${{ inputs.dest }}
- name: Archive trace file
# always() makes sure this step will run even if previous step fails
if: ${{ always() && inputs.trace }}
uses: actions/upload-artifact@v2
with:
name: trace
path: |
${{ inputs.dest }}/trace.zip