Skip to content

Commit

Permalink
Fix #23
Browse files Browse the repository at this point in the history
  • Loading branch information
manoelcampos committed Dec 1, 2021
1 parent f00e1b8 commit 9759121
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,36 +54,46 @@ if [[ $INPUT_SLIDES_SKIP_ASCIIDOCTOR_BUILD == false ]]; then
ln -s "README.html" "`dirname $FILE`/index.html";
done

for FILE in `find . -name "*.html"`; do
git add -f "$FILE";
done

find . -name "*$INPUT_ADOC_FILE_EXT" | xargs git rm -f --cached
fi

PDF_FILE="ebook.pdf"
if [[ $INPUT_PDF_BUILD == true ]]; then
PDF_FILE="ebook.pdf"
INPUT_EBOOK_MAIN_ADOC_FILE="$INPUT_EBOOK_MAIN_ADOC_FILE$INPUT_ADOC_FILE_EXT"
MSG="Building $PDF_FILE ebook from $INPUT_EBOOK_MAIN_ADOC_FILE"
echo $MSG
asciidoctor-pdf "$INPUT_EBOOK_MAIN_ADOC_FILE" -o "$PDF_FILE" $INPUT_ASCIIDOCTOR_PARAMS
git add -f "$PDF_FILE";
fi

SLIDES_FILE="slides.html"
if [[ $INPUT_SLIDES_BUILD == true ]]; then
echo "Build AsciiDoc Reveal.js slides"
SLIDES_FILE="slides.html"
INPUT_SLIDES_MAIN_ADOC_FILE="$INPUT_SLIDES_MAIN_ADOC_FILE$INPUT_ADOC_FILE_EXT"
MSG="Building $SLIDES_FILE with AsciiDoc Reveal.js from $INPUT_SLIDES_MAIN_ADOC_FILE"
echo $MSG
asciidoctor-revealjs -a revealjsdir=https://cdnjs.cloudflare.com/ajax/libs/reveal.js/3.9.2 "$INPUT_SLIDES_MAIN_ADOC_FILE" -o "$SLIDES_FILE"
git add -f "$SLIDES_FILE";
fi

# Executes any post-processing command provided by the user, before changes are committed.
# If no command is provided, the default value is just an echo command.
echo "Running post build command."
eval "$INPUT_POST_BUILD"

echo "Adding output files to gh-pages branch."
if [[ $INPUT_SLIDES_SKIP_ASCIIDOCTOR_BUILD == false ]]; then
for FILE in `find . -name "*.html"`; do
git add -f "$FILE";
done
fi

if [[ $INPUT_PDF_BUILD == true ]]; then
git add -f "$PDF_FILE";
fi

if [[ $INPUT_SLIDES_BUILD == true ]]; then
git add -f "$SLIDES_FILE";
fi

MSG="Build $INPUT_ADOC_FILE_EXT Files for GitHub Pages from $COMMIT_HASH"
git rm -rf .github/ || true
echo "Committing changes to gh-pages branch"
Expand Down

0 comments on commit 9759121

Please sign in to comment.