-
Notifications
You must be signed in to change notification settings - Fork 4
/
action.yaml
executable file
·76 lines (66 loc) · 2.46 KB
/
action.yaml
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
name: "Sync Paperpile to Notion"
description: "An unofficial CLI to sync your Paperpile Articles/Authors to Notion."
author: jmuchovej
branding:
icon: book
color: blue
inputs:
references:
description: "The path to your BibTeX containing the desired entries to sync"
required: true
token:
description: "Your Notion Integration Token"
required: true
references-diff:
description: "The path to your BibTeX to `diff` against"
required: false
runs:
using: "composite"
steps:
- name: "Install `paperpile-notion`"
shell: "bash"
run: "npm install -g @jmuchovej/paperpile-notion"
- continue-on-error: true
name: "Download `paperpile-notion` cache"
uses: "dawidd6/action-download-artifact@v2"
with:
workflow: "sync.yaml"
name: "paperpile-notion-cache"
path: ".cache/paperpile-notion/"
search_artifacts: true
- name: "Sync local `{.config,.cache}` with `~/{.config,.cache}`"
shell: "bash"
run: |
[ -d "$(pwd)/.cache" ] && rsync -a $(pwd)/.cache ${HOME}/
[ -d "$(pwd)/.config" ] && rsync -a $(pwd)/.config ${HOME}/
- name: "Sync Author's Database"
shell: "bash"
env:
DEBUG: "@jitl/notion-api:cms:cache,@jtil/notion-api:children,@jitl/notion-api:iterate"
run: |
paperpile-notion authors:sync ${{ inputs.references }} ${{ inputs.references-diff }} -t ${{ inputs.token }}
- name: "Sync Article's Database"
shell: "bash"
env:
DEBUG: "@jitl/notion-api:cms:cache,@jtil/notion-api:children,@jitl/notion-api:iterate"
run: |
paperpile-notion articles:sync ${{ inputs.references }} ${{ inputs.references-diff }} -t ${{ inputs.token }}
- name: "Clean Author's Database"
shell: "bash"
env:
DEBUG: "@jitl/notion-api:cms:cache,@jtil/notion-api:children,@jitl/notion-api:iterate"
run: |
paperpile-notion authors:clean ${{ inputs.references }} -t ${{ inputs.token }}
- name: "Clean Article's Database"
shell: "bash"
env:
DEBUG: "@jitl/notion-api:cms:cache,@jtil/notion-api:children,@jitl/notion-api:iterate"
run: |
paperpile-notion articles:clean ${{ inputs.references }} -t ${{ inputs.token }}
- if: always()
name: "Upload `paperpile-notion` cache as Artifact"
uses: "actions/upload-artifact@v3"
with:
name: "paperpile-notion-cache"
path: "~/.cache/paperpile-notion/*.json"
retention-days: 90