diff --git a/.github/workflows/update-page.yml b/.github/workflows/update-page.yml index 8f26768..674e6eb 100644 --- a/.github/workflows/update-page.yml +++ b/.github/workflows/update-page.yml @@ -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 = ''' @@ -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 'action@github.com' 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