diff --git a/ottrpal/Dockerfile b/ottrpal/Dockerfile index b693fd9..584c1db 100644 --- a/ottrpal/Dockerfile +++ b/ottrpal/Dockerfile @@ -1,10 +1,12 @@ FROM jhudsl/base_ottr:dev LABEL maintainer="cansav09@gmail.com" -WORKDIR /app +WORKDIR /app COPY entrypoint.sh . RUN chmod +x entrypoint.sh ENTRYPOINT ["/app/entrypoint.sh"] + +WORKDIR /home diff --git a/ottrpal/entrypoint.sh b/ottrpal/entrypoint.sh index fda3bf1..5b855d8 100755 --- a/ottrpal/entrypoint.sh +++ b/ottrpal/entrypoint.sh @@ -2,14 +2,19 @@ if [ "$1" = "rmd" ]; then Rscript -e "bookdown::render_book('index.Rmd', output_format = 'all')" -elif [ "$1" = "quarto" ]; then +elif [ "$1" = "quarto" ] || [ "$1" = "quarto_web" ]; then Rscript -e "quarto::quarto_render('.')" +elif [ "$1" = "rmd_web" ]; then + Rscript -e "rmarkdown::render_site()" elif [ "$1" = "spelling" ] || [ "$1" = "urls" ] || [ "$1" = "quiz_format" ]; then Rscript -e "ottrpal::ottr_check(check_type = '$1')" - # Save output - echo "error_name=$error_name" >> $GITHUB_OUTPUT - echo "report_path=$report_path" >> $GITHUB_OUTPUT - echo "chk_results=$chk_results" >> $GITHUB_OUTPUT + + # Save output if we are on github + if [ -n "$GITHUB_REPOSITORY" ]; then + echo "error_name=$error_name" >> $GITHUB_OUTPUT 2>/dev/null + echo "report_path=$report_path" >> $GITHUB_OUTPUT 2>/dev/null + echo "chk_results=$chk_results" >> $GITHUB_OUTPUT 2>/dev/null + fi else - echo Viable options are "render_rmd", "render_quarto", "spelling", "urls", "quiz_format" + echo Error: Viable options are "render_rmd", "render_quarto", "spelling", "urls", "quiz_format" fi