Auto-Generation TEI #189
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: Transform | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'data/**' | |
workflow_dispatch: #Allows for manual triggering | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.TOKEN_PUSH }} | |
steps: | |
- name: checkout repo content | |
uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.ref }} | |
token: ${{ secrets.TOKEN_PUSH }} | |
fetch-depth: 0 | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install networkx lxml | |
- name: Convert files | |
run: | | |
for file in ./data/*/*/* ; do | |
if [ "${file: -9}" == "stemma.gv" ] || [ "${file: -12}" == "metadata.txt" ] ; | |
then python ./tests/transformation.py ${file} ; | |
fi | |
done | |
#- name: Commit files | |
# run: | | |
# git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
# git config --local user.name "github-actions[bot]" | |
# git add . | |
# git commit -m "[Automatic] Auto-Generation TEI" || echo "Nothing to commit" | |
# git push || echo "Nothing to push" | |
- name: Commit | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: Auto-Generation TEI |