-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (62 loc) · 2.52 KB
/
jupiterhub_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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Execute and Convert Notebooks
# Trigger manually
on:
workflow_dispatch:
jobs:
prepare-and-execute-notebooks:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Create and activate virtual environment
run: |
python -m venv venv
source venv/bin/activate
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Download dataset
run: |
# Download the dataset with the correct extension
curl -L -o datasets/originalPics.tar.gz http://vis-www.cs.umass.edu/fddb/originalPics.tar.gz
# Create the target directory
mkdir -p datasets/FDDB
# Extract the contents into the target directory
tar -xzvf datasets/originalPics.tar.gz -C datasets/FDDB
# Remove the downloaded .tar.gz file
rm datasets/originalPics.tar.gz
- name: Execute and convert notebook
run: |
# CD to correct directory
cd ${{ github.workspace }}
# Creating the directory for results
mkdir -p ./results
# Execute the notebook in-place
jupyter nbconvert --to notebook --execute compare_face_detection_accuracy.ipynb --inplace
jupyter nbconvert --to notebook --execute compare_face_detection_efficacy.ipynb --inplace
jupyter nbconvert --to notebook --execute compare_tracking.ipynb --inplace
jupyter nbconvert --to notebook --execute calculate_focal_length.ipynb --inplace
- name: Commit results
if: success()
run: |
git config --global user.email "action@github.com"
git config --global user.name "GitHub Action"
# Ensure we're on a branch that's not main to avoid direct commits
git checkout -b update-notebooks-${{ github.run_id }}
git add .
git commit -m "Automated notebook execution and conversion"
# Push the changes to the new branch
git push -u origin update-notebooks-${{ github.run_id }}
- name: Open Pull Request
uses: repo-sync/pull-request@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
pr_title: "Automated Notebook Update"
pr_body: "This PR includes executed notebooks and their conversions."
source_branch: "update-notebooks-${{ github.run_id }}"
destination_branch: "main"