All Projects → helaili → Jekyll Action

helaili / Jekyll Action

Licence: mit
A GitHub Action to publish Jekyll based content as a GitHub Pages site

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to Jekyll Action

Emacs Easy Hugo
Emacs major mode for managing hugo
Stars: ✭ 235 (+45.96%)
Mutual labels:  github-pages, asciidoc
minimalist
Minimalist is a Jekyll theme inspired by the Minimal theme
Stars: ✭ 48 (-70.19%)
Mutual labels:  jekyll-site, github-pages
Millennial
A minimalist Jekyll theme for running an online publication
Stars: ✭ 223 (+38.51%)
Mutual labels:  github-pages, jekyll-site
Jekyll Remote Theme
Jekyll plugin for building Jekyll sites with any GitHub-hosted theme
Stars: ✭ 188 (+16.77%)
Mutual labels:  github-pages, jekyll-site
Liberxue.github.io
Liberxue blog for lightweight Jekyll themes 轻量级自适应 简洁 卡片式博客主题 3秒搞定GitHub blog
Stars: ✭ 330 (+104.97%)
Mutual labels:  github-pages, jekyll-site
yk-liu.github.io
Pointing to the Moon, my personal website.
Stars: ✭ 82 (-49.07%)
Mutual labels:  jekyll-site, github-pages
portfolio-jekyll-theme
A minimalist Jekyll theme for building a personal portfolio site powered by Jekyll and GitHub Pages
Stars: ✭ 168 (+4.35%)
Mutual labels:  jekyll-site, github-pages
Hanuman
A responsive, lightning-fast Jekyll theme built using AMP (Accelerated Mobile Pages) to speed up your blogs and websites.
Stars: ✭ 100 (-37.89%)
Mutual labels:  github-pages, jekyll-site
startbootstrap-stylish-portfolio-jekyll
Jekyll theme based on Stylish Portfolio Bootstrap theme
Stars: ✭ 20 (-87.58%)
Mutual labels:  jekyll-site, github-pages
ljvmiranda921.github.io
Github repository for github.io website ✨
Stars: ✭ 33 (-79.5%)
Mutual labels:  jekyll-site, github-pages
Lagrange
A minimalist Jekyll theme for running a personal blog
Stars: ✭ 454 (+181.99%)
Mutual labels:  github-pages, jekyll-site
Jekyll Theme Yat
🎨 Yet another theme for elegant writers with modern flat style and beautiful night/dark mode.
Stars: ✭ 113 (-29.81%)
Mutual labels:  github-pages, jekyll-site
Books
📚 Find books from Google Play Books - For all the book lovers in the world. https://liyasthomas.github.io/books
Stars: ✭ 145 (-9.94%)
Mutual labels:  github-pages
Jekyll Theme Memoirs
Memoirs is a free minimalist Jekyll theme for those who love the beauty of simplicity.
Stars: ✭ 151 (-6.21%)
Mutual labels:  jekyll-site
Jekyll Theme Mdui
🍷A Jekyll theme based on MDUI
Stars: ✭ 143 (-11.18%)
Mutual labels:  github-pages
Git Wiki Theme
A revolutionary full-featured wiki for github pages and jekyll. You don't need to compile it!
Stars: ✭ 139 (-13.66%)
Mutual labels:  github-pages
Tmaize Blog
一款jekyll主题,简洁纯净,支持自适应,支持夜间模式
Stars: ✭ 152 (-5.59%)
Mutual labels:  jekyll-site
Gottovote
GotToVote is a toolkit of simple web and SMS services that help citizens get to the ballot box informed and ready to vote. Kenya version accessible at https://kenya.gottovote.cc
Stars: ✭ 150 (-6.83%)
Mutual labels:  github-pages
Bornmay
Awesome Github Profile Readme. Github ReadMe Github Profile Readme Dynamic Github ReadMe Dynamic Github Profile ReadMe. Please Star and Fork
Stars: ✭ 140 (-13.04%)
Mutual labels:  github-pages
Atom Asciidoc Preview
⚛ AsciiDoc preview for the Atom editor.
Stars: ✭ 136 (-15.53%)
Mutual labels:  asciidoc

jekyll-action

A GitHub Action to build and publish Jekyll sites to GitHub Pages

Out-of-the-box Jekyll with GitHub Pages allows you to leverage a limited, white-listed, set of gems. Complex sites requiring custom ones or non white-listed ones (AsciiDoc for instance) used to require a continuous integration build in order to pre-process the site.

Remember that GitHub is serving your built static site, not its sources. So when configuring GitHub Pages in your project settings, use gh-pages branch as a Source for GitHub Pages. If you are setting up username.github.io repository, you'll have to use master branch, so sources can be located in another orphaned branch in the repo (which you can safely mark as default after the first publication). In addition to that default behaviour, you can configure the branch this plugin pushes into with the target_branch-option. Keep in mind to set the source branch accordingly at the GitHub Pages Settings page.

Note that this is a rather simple (naive maybe) Docker based action. @limjh16 has created a JS based version of this action which saves the container download time and might help with non default use cases (such as but not limited to: specific package or library that is not available as a Gem).

Usage

Create a Jekyll site

If your repo doesn't already have one, create a new Jekyll site: jekyll new sample-site. See the Jekyll website for more information. In this repo, we have created a site within a sample_site folder within the repository because the repository's main goal is not to be a website. If it was the case, we would have created the site at the root of the repository.

Create a Gemfile

As you are using this action to leverage specific Gems, well, you need to declare them! In the sample below we are using the Jekyll AsciiDoc plugin

source 'https://rubygems.org'

gem 'jekyll', '~> 3.8.5'
gem 'coderay', '~> 1.1.0'

group :jekyll_plugins do
  gem 'jekyll-asciidoc', '~> 2.1.1'
end

Configure your Jekyll site

Edit the configuration file of your Jekyll site (_config.yml) to leverage these plugins. In our sample, we want to leverage AsciiDoc so we added the following section:

asciidoc: {}
asciidoctor:
  base_dir: :docdir
  safe: unsafe
  attributes:
    - idseparator=_
    - source-highlighter=coderay
    - icons=font

Note that we also renamed index.html to index.adoc and modified this file accordingly in order to leverage AsciiDoc.

Use the action

Use the helaili/[email protected] action in your workflow file. It needs access to the out-of-the-box GITHUB_TOKEN secret. The directory where the Jekyll site lives will be detected (based on the location of _config.yml) but you can also explicitly set this directory by setting the jekyll_src parameter (sample_site for us). The SRC environment variable is also supported for backward compatibilty but it is deprecated. The action will search for Gemfile location. If your want to specify it explicitly (e.g. if you have multiple Gemfiles per project), you should update gem_src input parameter accordingly.

Use the actions/cache action in the workflow as well, to shorten build times and decrease load on GitHub's servers

name: Testing the GitHub Pages publication

on:
  push

jobs:
  jekyll:
    runs-on: ubuntu-16.04
    steps:
    - uses: actions/[email protected]

    # Use GitHub Actions' cache to shorten build times and decrease load on servers
    - uses: actions/[email protected]
      with:
        path: vendor/bundle
        key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile') }}
        restore-keys: |
          ${{ runner.os }}-gems-

    # Standard usage
    - uses:  helaili/[email protected]
      with:
        token: ${{ secrets.GITHUB_TOKEN }}

    # Specify the Jekyll source location as a parameter
    - uses: helaili/[email protected]
      with:
        token: ${{ secrets.GITHUB_TOKEN }}
        jekyll_src: 'sample_site'

    # Specify the target branch (optional)
    - uses: helaili/[email protected]
      with:
        token: ${{ secrets.GITHUB_TOKEN }}
        target_branch: 'gh-pages'

Upon successful execution, the GitHub Pages publishing will happen automatically and will be listed on the environment tab of your repository.

image

Just click on the View deployment button of the github-pages environment to navigate to your GitHub Pages site.

image

Inputs

token

The GITHUB_TOKEN secret. This is mandatory unless build_only is set to true.

jekyll_env

The Jekyll environment to build (default to production)

jekyll_src

The Jekyll website source directory

jekyll_build_options

Additional Jekyll build arguments (see the Jekyll doc)

gem_src

The Jekyll Gemfile directory

target_branch

The target branch name the sources get pushed to

build_only

When set to true, the Jekyll site will be built but not published

pre_build_commands

Commands to run prior to build and deploy. Useful for ensuring build dependencies are up to date or installing new dependencies. For example, use apk --update add imagemagick to install ImageMagick.

keep_history

When set to true, previous version of the site will be restored before the Jekyll build takes place. You can then use the keep_files option in your _config.yml file to select the files you want to keep. Make sure you then keep at least the .git folder. This option will also remove the --force flag from the git commit... command.

keep_files: [.git, hello.html]

Deprecation

This action previously used a JEKYLL_PAT environment variable instead of the token parameter. This is now deprecated.

I have a problem

Create a ACTIONS_STEP_DEBUG secret with value true and run the workflow again.

Note on custom domains

If you're using a Custom Domain for your GitHub Pages site, you will need to ensure that the CNAME file exists in the repository root of the main (or master) branch so that it can be copied to the deployment root when your site is deployed.

If your GitHub Pages site is run off the main (or master) branch, you can modify the Custom Domain setting in the Repository Settings to automatically generate and commit the CNAME file.

If your GitHub Pages site is run off an alternate branch, however, you will need to manually create and commit the CNAME file with your custom domain as its contents, otherwise the file will be committed to the deployment branch and overwritten the next time the action is run.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].