Skip to content

Build and deploy Jekyll site to GitHub Pages #1640

Build and deploy Jekyll site to GitHub Pages

Build and deploy Jekyll site to GitHub Pages #1640

Workflow file for this run

name: Build and deploy Jekyll site to GitHub Pages
on:
schedule:
# update site once per day so that the list of projects using Padauk is refreshed even if we don't push to master.
- cron: '0 0 * * *'
push:
branches:
- production
jobs:
github-pages:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
# https://github.com/actions/cache/blob/master/examples.md#ruby---bundler
- uses: actions/cache@v3
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
# Manually install libffi7 to maintain compatibility with old ruby version
- name: Install libffi7
run: sudo apt-get update && sudo apt-get install -y libffi7
- name: 💎 setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
# https://github.com/actions/cache/blob/master/examples.md#ruby---bundler
- name: Jekyll build
run: |
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
bundle exec jekyll build --trace
env:
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
- name: Upload to GitHub Pages
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: _site
CLEAN: true
SINGLE_COMMIT: true
GIT_CONFIG_NAME: GitHub Actions
GIT_CONFIG_EMAIL: gh-actions@example.com