-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
05fdb8a
commit d0584b5
Showing
1 changed file
with
4 additions
and
26 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,6 @@ jobs: | |
import os | ||
import html | ||
from datetime import datetime | ||
import shutil | ||
def get_file_icon(file): | ||
ext = os.path.splitext(file)[1].lower() | ||
|
@@ -40,23 +39,13 @@ jobs: | |
def generate_html(): | ||
file_list = [] | ||
example_data_dir = './example_data' | ||
if not os.path.exists(example_data_dir): | ||
print(f"Error: {example_data_dir} directory not found.") | ||
return | ||
for root, dirs, files in os.walk(example_data_dir): | ||
for root, dirs, files in os.walk('.'): | ||
for file in files: | ||
if file != 'index.html' and not file.startswith('.'): | ||
path = os.path.join(root, file) | ||
rel_path = os.path.relpath(path, example_data_dir) | ||
size = os.path.getsize(path) | ||
mtime = os.path.getmtime(path) | ||
file_list.append((rel_path, size, mtime)) | ||
# Copy file to current directory | ||
shutil.copy2(path, os.path.join('.', rel_path)) | ||
file_list.append((path, size, mtime)) | ||
html_content = ''' | ||
<!DOCTYPE html> | ||
|
@@ -117,28 +106,17 @@ jobs: | |
with open('index.html', 'w') as f: | ||
f.write(html_content) | ||
print(f"index.html has been created in {os.getcwd()}") | ||
generate_html() | ||
EOF | ||
- name: Generate Pathoplexus example data list | ||
run: python generate_list.py | ||
|
||
- name: Debug - List directory contents | ||
run: | | ||
echo "Current directory:" | ||
pwd | ||
echo "Files in current directory:" | ||
ls -la | ||
- name: Commit and push to gh-pages | ||
run: | | ||
git config --global user.name 'GitHub Action' | ||
git config --global user.email '[email protected]' | ||
git checkout -b gh-pages | ||
git add index.html || echo "index.html not found" | ||
git add example_data/* || echo "No files in example_data" | ||
git status | ||
git commit -m "Update Pathoplexus example data list" || echo "No changes to commit" | ||
git add index.html | ||
git commit -m "Update Pathoplexus example data list" || exit 0 | ||
git push -f origin gh-pages |