Skip to content

Commit

Permalink
Close #21
Browse files Browse the repository at this point in the history
  • Loading branch information
manoelcampos committed Jul 14, 2021
1 parent f011392 commit 0ed4f97
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/asciidoctor-ghpages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ jobs:
# adoc_file_ext: .ascii # default is .adoc
# source_dir: docs/ # default is .
# slides_build: true
# pre_build:
# post_build:
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ inputs:
description: 'If slides are being generated using AsciiDoc Reveal.js, you may not want to build the regular html files using the asciidoctor command, but just using the asciidoctor-revealjs command. In order to generate only the slides.html instead of the regular html files, set this config to true.'
default: 'false'
required: false
pre_build:
description: 'Any arbitrary shell command to be executed before the asciidoc build is started. Optional.'
default: 'echo "No pre build command provided."'
required: false
post_build:
description: 'Any arbitrary shell command to be executed after the asciidoc build is complete and before committing changes on gh-pages branch. Optional.'
default: 'echo "No post build command provided."'
Expand All @@ -54,4 +58,5 @@ runs:
- ${{ inputs.slides_skip_asciidoctor_build }}
- ${{ inputs.pdf_build }}
- ${{ inputs.ebook_main_adoc_file }}
- ${{ inputs.pre_build }}
- ${{ inputs.post_build }}
7 changes: 5 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
# Exit if a command fails
set -e

sh -c "echo 'Input Parameters:' $*"

OWNER="$(echo $GITHUB_REPOSITORY| cut -d'/' -f 1)"

if [[ "$INPUT_ADOC_FILE_EXT" != .* ]]; then
Expand Down Expand Up @@ -43,6 +41,11 @@ else
git checkout "$COMMIT_HASH" -B gh-pages
fi

# Executes any arbitrary shell command (such as packages installation and environment setup)
# before starting build.
# If no command is provided, the default value is just an echo command.
eval "$INPUT_PRE_BUILD"

if [[ $INPUT_SLIDES_SKIP_ASCIIDOCTOR_BUILD == false ]]; then
echo "Converting AsciiDoc files to HTML"
find . -name "*$INPUT_ADOC_FILE_EXT" | xargs asciidoctor -b html $INPUT_ASCIIDOCTOR_PARAMS
Expand Down

0 comments on commit 0ed4f97

Please sign in to comment.