diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index b69fa5d..dfc9eed 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -46,7 +46,9 @@ jobs:
find \"/workspace/\$FOLDER\" \( -name '*.qmd' -o -name '*.ipynb' \) | while read -r file; do
echo \"Processing file: \$file\"
- target_dir=\"/workspace/gallery/\$(dirname \"\$file\")\"
+ # Remove the /workspace prefix from the file path
+ relative_dir=\$(dirname \"\${file#'/workspace/'}\")
+ target_dir=\"/workspace/gallery/\$relative_dir\"
echo \"Creating target directory: \$target_dir\"
mkdir -p \"\$target_dir\" && echo \"Directory \$target_dir created.\"
@@ -71,8 +73,10 @@ jobs:
ls -laR gallery
echo "
Gallery Index
" > gallery/index.html
find gallery -name "*.html" | while read -r file; do
+ # Remove the 'gallery/' prefix from the file path
+ relative_path="${file#gallery/}"
file_name=$(basename "$file")
- echo "- $file_name
" >> gallery/index.html
+ echo "- $file_name
" >> gallery/index.html
done
echo "
" >> gallery/index.html
@@ -108,7 +112,11 @@ jobs:
echo "No changes to commit."
else
# Commit and push changes
- git add gallery
+ # First Remove any files in the gallery directory that no longer exist locally
+ git rm -r --cached gallery
+
+ # Add all current changes from the gallery folder
+ git add -A gallery
git commit -m "Update rendered Quarto files for GitHub Pages (commit: ${{ github.sha }})"
git push origin docs --force
fi
diff --git a/Dockerfile b/Dockerfile
index 3b8b04c..bf1fe71 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -28,6 +28,7 @@ RUN apt-get update && apt-get install -y \
gdebi-core \
software-properties-common \
ffmpeg \
+ expect \
&& apt-get clean
# Install Python 3.12.5