Skip to content

Commit

Permalink
Update update-page.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
theosanderson authored Aug 30, 2024
1 parent 05fdb8a commit d0584b5
Showing 1 changed file with 4 additions and 26 deletions.
30 changes: 4 additions & 26 deletions .github/workflows/update-page.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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>
Expand Down Expand Up @@ -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

0 comments on commit d0584b5

Please sign in to comment.