Skip to content

Commit

Permalink
Update workflow to place HTML files in the same directories as the or…
Browse files Browse the repository at this point in the history
…iginal Markdown files
  • Loading branch information
zli86605 committed Jul 10, 2024
1 parent d73ac0c commit 96c850e
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/w4h-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,17 @@ jobs:
- name: List files for debugging
run: |
echo "Listing all files:"
echo "Listing all Markdown files:"
find . -name '*.md'
echo "Current directory structure:"
ls -R
- name: Convert Markdown to HTML
run: |
mkdir -p html
find . -name '*.md' | while read -r file; do
htmlfile="html/${file#./}"
htmlfile="${htmlfile%.md}.html"
htmlfile="${file%.md}.html"
echo "Converting $file to $htmlfile"
mkdir -p "$(dirname "$htmlfile")"
pandoc "$file" -o "$htmlfile" --extract-media=html
pandoc "$file" -o "$htmlfile" --extract-media .
if [ $? -eq 0 ]; then
echo "Successfully converted $file"
else
Expand All @@ -53,7 +50,7 @@ jobs:
run: |
git config --local user.name 'github-actions[bot]'
git config --local user.email 'github-actions[bot]@users.noreply.github.com'
git add html/*
git add **/*.html
git commit -m 'Automatically convert MD to HTML'
git push
env:
Expand Down

0 comments on commit 96c850e

Please sign in to comment.