Add name and behaviour to workflow #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" ]]; 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: | |
path: | | |
*_cards.tar.gz | |