Deploy Jekyll site(s) into gh-pages
using this custom GitHub Action.
A GitHub Action for building and deploying a Jekyll site into a gh-pages
branch.
.github/workflows
at the base of your Jekyll project including the dot.jekyll.yml
inside the folder above with the following:name: Jekyll Deploy
on:
push:
branches:
- master
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- name: GitHub Checkout
uses: actions/checkout@v1
- name: Bundler Cache
uses: actions/cache@v1
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Build & Deploy to GitHub Pages
uses: 0xnu/jekyll-4-deploy-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ secrets.GITHUB_REPOSITORY }}
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
Set JEKYLL_DESTINATION
with a variable if you don't want to _site
as your default directory.
name: Jekyll Deploy
on:
push:
branches:
- master
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- name: GitHub Checkout
uses: actions/checkout@v1
- name: Bundler Cache
uses: actions/cache@v1
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Build & Deploy to GitHub Pages
uses: 0xnu/jekyll-4-deploy-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ secrets.GITHUB_REPOSITORY }}
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
JEKYLL_DESTINATION: prod
Exclude vendor
directory from being built in _config.yml
so it doesn't break the build as it suggests you put gems in ./vendor/bundle
# Excludes
exclude: ["vendor"]
This project is licensed under the WTFPL License - see the file for details.
(c) 2020 Finbarrs Oketunji. 🐼