Skip to content
This repository has been archived by the owner on Feb 24, 2025. It is now read-only.

Commit

Permalink
removed adding requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
miloswrath committed Sep 13, 2024
1 parent d679ed9 commit aafb208
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 5 deletions.
70 changes: 69 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: set up python
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: parse raw
id: set_vars
Expand Down Expand Up @@ -86,6 +86,74 @@ jobs:
done
done
done
add:

concurrency:
group: "pages"
cancel-in-progress: false
runs-on: self-hosted
needs: run_qc
steps:
- name: find new png files
run: |
png_files=$(git diff --name-only --relative --diff-filter=A -- '*.png')
echo png_files << GITHUB_ENV
- name: Add _posts
run: |
POSTS_DIR="_posts"
# Loop through the images and group by subject number
declare -A subjects
for file in "$png_files"; do
# Extract the subject number (assuming it's the first part of the filename before '_')
subject=$("$file" | awk -F_ '{print $1}')
# Append the filename to the subject's array
subjects["$subject"]+="$file "
done
# Generate Jekyll posts
for subject in "${!subjects[@]}"; do
# Define the post filename (e.g., using current date and subject number)
post_filename="$POSTS_DIR/$(date +%Y-%m-%d)-subject-$subject.md"
# Create the Jekyll post
echo "---" > "$post_filename"
echo "layout: post" >> "$post_filename"
echo "title: Subject $subject" >> "$post_filename"
echo "date: $(date +%Y-%m-%d)" >> "$post_filename"
echo "categories: subjects" >> "$post_filename"
echo "---" >> "$post_filename"
# Add images to the post
for image in ${subjects["$subject"]}; do
echo "![]($image)" >> "$post_filename"
done
done
- name: checkout
uses: actions/checkout@v4

- name: Setup Ruby
uses: ruby/setup-ruby@8575951200e472d5f2d95c625da0c7bec8217c42 # v1.161.0
with:
ruby-version: '3.1' # Not needed with a .ruby-version file
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
cache-version: 0 # Increment this number if you need to re-download cached gems
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5
- name: Build with Jekyll
# Outputs to the './_site' directory by default
run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
env:
JEKYLL_ENV: production
- name: Upload artifact
# Automatically uploads an artifact from the './_site' directory by default
uses: actions/upload-pages-artifact@v3

push:
runs-on: self-hosted
Expand Down
8 changes: 4 additions & 4 deletions jatosAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def get_met():
'Content-Type': 'application/json',
}
data = {
'studyIds': [946, 961, 991, 899, 920, 933]
'studyIds': [945, 960, 990, 898, 919, 932]
}

response = requests.post(url, headers=headers, json=data)
Expand All @@ -34,10 +34,10 @@ def get_met():

# Get the current timestamp
current_time = datetime.now().timestamp() * 1000 # Convert to milliseconds
one_day_ago = current_time - (24 * 60 * 60 * 1000) # 24 hours ago in milliseconds
one_day_ago = current_time - 5*(24 * 60 * 60 * 1000) # 24 hours ago in milliseconds

# Initialize an empty list to store study result IDs
study_result_ids = [10634]
study_result_ids = []

# Iterate through the data to check conditions and collect study result IDs
for study in response['data']:
Expand All @@ -63,7 +63,7 @@ def get_data(study_result_ids):
}
# Get the data for each study result
datas = {
'studyIds': [946, 961, 991, 899, 920, 933],
'studyIds': [945, 960, 990, 898, 919, 932],
'studyResultIds': study_result_ids
}

Expand Down

0 comments on commit aafb208

Please sign in to comment.