From 63b2cf394092e9d590f6c180eae42a8d1303e98b Mon Sep 17 00:00:00 2001 From: Ruben Swieringa Date: Thu, 1 Sep 2022 20:46:42 +0100 Subject: [PATCH] Add drafts parameter --- README.md | 13 +++++++++++++ action.yml | 6 ++++++ entrypoint.sh | 7 ++++++- 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3400fad..a3d8711 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,19 @@ jobs: aws s3 sync ./_site/ s3://my-s3-bucket --delete ``` +# Parameters + +## Drafts + +Pass `true` to preview your site with drafts: + +```yaml +- name: Build + uses: jerryjvl/jekyll-build-action@v1 + with: + drafts: true +``` + # References For more technical details on these steps and associated setup, see: - [actions/checkout](https://github.com/actions/checkout) diff --git a/action.yml b/action.yml index c408fe3..d199458 100644 --- a/action.yml +++ b/action.yml @@ -3,6 +3,12 @@ description: 'Local pipeline build of Jekyll content; follow-on actions must pub runs: using: 'docker' image: 'Dockerfile' + args: + - ${{ inputs.drafts }} +inputs: + drafts: + description: 'Whether to include draft posts in build (defaults to false)' + required: false branding: icon: 'book-open' color: 'white' diff --git a/entrypoint.sh b/entrypoint.sh index 36c33b9..1c557d6 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -15,7 +15,12 @@ chmod -R a+w /github/workspace # Build the Jekyll site #################################################### -jekyll build --trace +if [ "$1" = "true" ] +then + jekyll build --trace --drafts +else + jekyll build --trace +fi #################################################### # Build completed