Skip to content

This repository stores the source code for a GitHub action that validates whether a Jekyll website can successfully build.

License

Notifications You must be signed in to change notification settings

PaulRosenthal/Jekyll-Deploy-Test-Action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

Jekyll Deploy Test GitHub Action

Automated Validation

This GitHub action validates whether a Jekyll website contains the necessary configuration to successfully build using GitHub Pages. It is intended to be used in a continuous integration (CI) pipeline or as part of a testing process.

Inputs

gemfile-location

Optional This variable contains the location of the gemfile. By default, this is the root of the repository.

site-directory

Optional This variable contains the location of the Jekyll website. By default, this is the root of the repository

Output

The action outputs a value of "0" if the website builds correctly, and outputs a value of "1" if attempting to build the website fails. The action builds the website with the "--verbose" option; thus, looking at the action results can be helpful for troubleshooting failures.

How to Use

The .github/workflows/automated-validation.yml file in this repository contains an example workflow that executes this action. Additionally, below are two examples for incorporating this action into an existing workflow:

Example With Variables

- name: Checkout Repository
  uses: actions/checkout@v3
- uses: PaulRosenthal/Jekyll-Deploy-Test-Action@v3
  with:
    gemfile-location: '/sample-jekyll-website'
    site-directory: '/sample-jekyll-website'

Example Without Variables

- name: Checkout Repository
  uses: actions/checkout@v3
- uses: PaulRosenthal/Jekyll-Deploy-Test-Action@v3

Example With Variables and Archiving Test Build

The test build files can be archived each time a workflow is executed, and downloaded for review or further verification.

In the example below, files from the test build will be saved in a zip file titled test_build:

- name: Checkout Repository
  uses: actions/checkout@v3
- uses: PaulRosenthal/Jekyll-Deploy-Test-Action@v3
  with:
    gemfile-location: '/sample-jekyll-website'
    site-directory: '/sample-jekyll-website'
- uses: actions/upload-artifact@v3.1.0
  with:
    name: test_build
    path: sample-jekyll-website/_site

About

This repository stores the source code for a GitHub action that validates whether a Jekyll website can successfully build.

Resources

License

Stars

Watchers

Forks

Packages

No packages published