-
Notifications
You must be signed in to change notification settings - Fork 11
48 lines (37 loc) · 1.44 KB
/
update-dalia-csv.yml
File metadata and controls
48 lines (37 loc) · 1.44 KB
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
name: Update DALIA CSV on Resource Change
on:
pull_request:
paths:
- 'resources/nfdi4bioimage.yml'
jobs:
update-dalia-csv:
runs-on: ubuntu-latest
steps:
# Checkout repository
- name: Checkout repository
uses: actions/checkout@v2
# Set up Python environment
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
# Install dependencies
- name: Install dependencies
run: |
pip install -r requirements.txt
pip install nbconvert transformers torch
sudo apt-get install -y poppler-utils
# Execute the Notebook to export CSV in DALIA format
- name: Execute Jupyter Notebook
run: |
jupyter nbconvert --execute --inplace scripts/Export_to_DALIA.ipynb
# Commit and push changes if any file was updated
- name: Commit and push changes
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add .
git diff --staged --quiet || git commit -m "Auto-update CSV after modifying nfdi4bioimage.yml"
git pull --rebase origin ${{ github.head_ref }}
# Authenticate and push
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:${{ github.head_ref }}