Build and deploy Jekyll site to GitHub Pages #1115
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
# https://github.com/actions/cache/blob/master/examples.md#ruby---bundler | |
- uses: actions/cache@v1 | |
with: | |
path: vendor/bundle | |
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} | |
restore-keys: | | |
${{ runner.os }}-gems- | |
- 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: [email protected] |