-
Notifications
You must be signed in to change notification settings - Fork 2
42 lines (34 loc) · 996 Bytes
/
workflow.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
name: Generate Anki Packages
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.x environment
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install markdown-anki-decks
run: |
python -m venv venv
source venv/bin/activate
pip install markdown-anki-decks
- name: Generate Anki packages and compress
run: |
source venv/bin/activate
for dir in */ ; do
if [[ -d "$dir" && ! -L "$dir" && "$dir" != "*/" ]]; then
dirname=$(basename "$dir")
result_dir="${dirname}_Result"
mkdir -p "$result_dir"
mdankideck "$dir" "$result_dir"
tar -czvf "${dirname}_cards.tar.gz" -C "$result_dir" .
fi
done
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: flashcards
path: |
*_cards.tar.gz