Skip to content

Allow CI on parser-rewrite branch #26

Allow CI on parser-rewrite branch

Allow CI on parser-rewrite branch #26

Workflow file for this run

name: Generate Anki Packages
on:
push:
branches:
- main
- parser-rewrite
paths-ignore:
- 'README.md'
- 'LICENSE'
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: Set up private key
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
run: |
mkdir -p $HOME/.ssh
echo "$SSH_PRIVATE_KEY" | base64 --decode > $HOME/.ssh/id_ed25519
chmod 600 $HOME/.ssh/id_ed25519
ssh-keyscan -H ${{ secrets.MIRROR_IP }} >> $HOME/.ssh/known_hosts
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends zip git
python -m venv venv
source venv/bin/activate
git clone https://github.com/hmelder/AnkiTUM-Runtime
pip3 install ./AnkiTUM-Runtime
- name: Generate Anki packages and compress
run: |
source venv/bin/activate
sh build.sh
- name: Upload via SFTP
env:
MIRROR_IP: ${{ secrets.MIRROR_IP }}
MIRROR_USER: ${{ secrets.MIRROR_USER }}
run: |
sftp -i $HOME/.ssh/id_rsa $MIRROR_USER@$MIRROR_IP:/var/www/html/anki-decks/beta <<< $'put -r build/*.zip'