-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (46 loc) · 1.38 KB
/
anki.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
name: Create Anki Decks release from markdown
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
convert_via_md2apkg:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
- run: npm install -g md2apkg
- run: mkdir output
- run: |
while read -r line;do
inputpath=$(echo $line | awk -F\; '{print $1}');
name=$(echo $line | awk -F\; '{print $2}');
md2apkg -o output/${name} ${inputpath};
done < "anki.list"
- uses: actions/upload-artifact@master # upload decks as an artifact
with:
name: output
path: output
release_decks:
runs-on: ubuntu-20.04
needs: convert_via_md2apkg
if: github.ref == 'refs/heads/main' # only publish if commited to the main branch
steps:
- name: Retrieve saved Docker image
uses: actions/download-artifact@v2
with:
name: output
path: output
- uses: meeDamian/[email protected] # create/override a release and attach apkgs
with:
token: ${{ secrets.ACCESS_TOKEN }}
tag: anki-release
name: Anki Decks
body: Dieses Release wurde automatisch erstellt
gzip: false
files: output/**.apkg
allow_override: true