-
Notifications
You must be signed in to change notification settings - Fork 4
67 lines (56 loc) · 1.84 KB
/
clean-up.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
name: "Sync Paperpile to Notion"
on:
workflow_dispatch: { }
workflow_call:
inputs:
references:
description: "The path to your BibTeX containing the desired entries to sync"
required: true
secrets:
token:
description: "Your Notion Integration Token"
required: true
push:
paths:
- "**.bib"
jobs:
sync-to-notion:
name: "Sync Paperpile to Notion"
runs-on: "ubuntu-latest"
concurrency:
group: "paperpile-notion-clean"
cancel-in-progress: false
steps:
- name: "Install `paperpile-notion`"
shell: "bash"
run: "npm install -g @jmuchovej/paperpile-notion"
- name: "Checkout repository"
uses: "actions/checkout@v3"
- continue-on-error: true
name: "Download the clean-up cache"
uses: "dawidd6/action-download-artifact@v2"
with:
workflow: "clean-up.yaml"
name: "paperpile-notion-cache:clean-up"
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: "Clean Author's Database"
shell: "bash"
run: |
paperpile-notion authors:clean ${{ inputs.references }} -t ${{ inputs.token }}
- name: "Clean Article's Database"
shell: "bash"
run: |
paperpile-notion articles:clean ${{ inputs.references }} -t ${{ inputs.token }}
- if: always()
name: "Upload the clean-up cache"
uses: "actions/upload-artifact@v3"
with:
name: "paperpile-notion-cache:clean-up"
path: "~/.cache/paperpile-notion/*.json"
retention-days: 90