Skip to content

Commit

Permalink
add steps for venv
Browse files Browse the repository at this point in the history
  • Loading branch information
MeWu-IDM committed Sep 25, 2024
1 parent 5bedf28 commit 0f5c234
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 15 deletions.
33 changes: 18 additions & 15 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,30 +25,33 @@ jobs:
run: |
docker run --rm -v ${{ github.workspace }}:/workspace -w /workspace demo-quarto-image bash -c "
echo 'Creating gallery directory...'
mkdir -p gallery && \
mkdir -p gallery && chmod -R 777 gallery && \
echo 'gallery directory created.'
FOLDERS=(python R)
echo 'Folders to process: ${FOLDERS[@]}'
source /opt/venv/bin/activate
echo 'activated virtualenv.'
FOLDERS=(python r)
echo 'Folders to process: \${FOLDERS[@]}'
for FOLDER in \"\${FOLDERS[@]}\"; do
echo 'Searching for .qmd and .ipynb files in $FOLDER...'
find \"\$FOLDER\" \( -name '*.qmd' -o -name '*.ipynb' \) | while read file; do
echo \"Searching for .qmd and .ipynb files in \$FOLDER...\"
find \"\$FOLDER\" \( -name '*.qmd' -o -name '*.ipynb' \) | while read -r file; do
echo 'Processing file: $file'
target_dir='gallery/$(dirname \"$file\")'
echo 'Creating target directory: $target_dir'
mkdir -p \"\$target_dir\" && echo 'Directory $target_dir created.'
echo \"Processing file: \$file\"
target_dir=\"gallery/\$(dirname \"\$file\")\"
echo \"Creating target directory: \$target_dir\"
mkdir -p \"\$target_dir\" && echo \"Directory \$target_dir created.\"
echo 'Attempting to render $file with execution...'
echo \"Attempting to render \$file with execution...\"
if quarto render \"\$file\" --to html --output-dir \"\$target_dir\"; then
echo 'Successfully rendered $file with execution.'
echo \"Successfully rendered \$file with execution.\"
else
echo 'Failed to render $file with execution. Rendering without execution...'
echo \"Failed to render \$file with execution. Rendering without execution...\"
if quarto render \"\$file\" --to html --no-execute --output-dir \"\$target_dir\"; then
echo 'Successfully rendered $file without execution.'
echo \"Successfully rendered \$file without execution.\"
else
echo 'Rendering failed for $file, even without execution.'
echo \"Rendering failed for \$file, even without execution.\"
fi
fi
Expand Down
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ RUN dpkg -i quarto-1.5.57-linux-amd64.deb
WORKDIR /app

COPY r /app/r
COPY python /app/python

# Install python packages in venv
RUN /opt/venv/bin/pip install -r python/requirements.txt

EXPOSE 8787
EXPOSE 8888
Expand Down

0 comments on commit 0f5c234

Please sign in to comment.