autobuilds for the jekyll-deploy github action
210
Builds and deploys a jekyll page to GitHub pages.
Features:
To deploy from master and update once a day:
name: Jekyll Deploy
on:
push:
branches:
# only deploy from master
- master
schedule:
# redeploy every morning to update unpublished pages
- cron: "0 2 * * *"
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cache gems
uses: actions/cache@v1
with:
path: vendor/gems
key: ${{ runner.os }}-build-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-build-
${{ runner.os }}-
- name: Build & Deploy to GitHub Pages
uses: DavidS/jekyll-deploy@master
env:
JEKYLL_ENV: production
GH_PAGES_TOKEN: ${{ secrets.GH_PAGES_TOKEN }}
To check PRs, set build-only: true:
name: Jekyll Test
on: [ pull_request ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cache gems
uses: actions/cache@v1
with:
path: vendor/gems
key: ${{ runner.os }}-build-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-build-
${{ runner.os }}-
- name: Test
uses: DavidS/jekyll-deploy@master
with:
build-only: true
env:
JEKYLL_ENV: production
GH_PAGES_TOKEN: ${{ secrets.GH_PAGES_TOKEN }}
The GH_PAGES_TOKEN needs the public_repo scope to be able to trigger deployments on a public repo or the full repo scope to deploy a private repository. Please note that this is circumventing GitHub's protection for infinitely recursive Actions invocations, so proceed with caution!
If your site's source is not at the root of the repository, you can use the source-dir input to tell this action where the source can be found. For example, if your site is in a docs/jekyll subdirectory:
- name: Build & Deploy to custom branch
uses: DavidS/jekyll-deploy@master
with:
source-dir: docs/jekyll
env:
JEKYLL_ENV: production
GH_PAGES_TOKEN: ${{ secrets.GH_PAGES_TOKEN }}
By default, this action deploys the compiled output to gh-pages, GitHub's default. If you want to use a different branch, you can use the target-branch input to do so. For example, to deploy to master:
- name: Build & Deploy to custom branch
uses: DavidS/jekyll-deploy@master
with:
target-branch: master
env:
JEKYLL_ENV: production
GH_PAGES_TOKEN: ${{ secrets.GH_PAGES_TOKEN }}
Content type
Image
Digest
Size
319.1 MB
Last updated
about 6 years ago
docker pull develops/jekyll-deploy