Skip to content

Commit 0ed4f97

Browse files
committed
Close #21
1 parent f011392 commit 0ed4f97

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

.github/workflows/asciidoctor-ghpages.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,5 @@ jobs:
2929
# adoc_file_ext: .ascii # default is .adoc
3030
# source_dir: docs/ # default is .
3131
# slides_build: true
32+
# pre_build:
3233
# post_build:

action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ inputs:
3737
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.'
3838
default: 'false'
3939
required: false
40+
pre_build:
41+
description: 'Any arbitrary shell command to be executed before the asciidoc build is started. Optional.'
42+
default: 'echo "No pre build command provided."'
43+
required: false
4044
post_build:
4145
description: 'Any arbitrary shell command to be executed after the asciidoc build is complete and before committing changes on gh-pages branch. Optional.'
4246
default: 'echo "No post build command provided."'
@@ -54,4 +58,5 @@ runs:
5458
- ${{ inputs.slides_skip_asciidoctor_build }}
5559
- ${{ inputs.pdf_build }}
5660
- ${{ inputs.ebook_main_adoc_file }}
61+
- ${{ inputs.pre_build }}
5762
- ${{ inputs.post_build }}

entrypoint.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
# Exit if a command fails
44
set -e
55

6-
sh -c "echo 'Input Parameters:' $*"
7-
86
OWNER="$(echo $GITHUB_REPOSITORY| cut -d'/' -f 1)"
97

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

44+
# Executes any arbitrary shell command (such as packages installation and environment setup)
45+
# before starting build.
46+
# If no command is provided, the default value is just an echo command.
47+
eval "$INPUT_PRE_BUILD"
48+
4649
if [[ $INPUT_SLIDES_SKIP_ASCIIDOCTOR_BUILD == false ]]; then
4750
echo "Converting AsciiDoc files to HTML"
4851
find . -name "*$INPUT_ADOC_FILE_EXT" | xargs asciidoctor -b html $INPUT_ASCIIDOCTOR_PARAMS

0 commit comments

Comments
 (0)