Skip to content

Build and deploy jekyll site to Netlify #1986

Build and deploy jekyll site to Netlify

Build and deploy jekyll site to Netlify #1986

name: "Build and deploy jekyll site to Netlify"
on:
schedule:
- cron: "0 6,13-15,18,22 * * *"
workflow_dispatch:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: 📂 setup
uses: actions/checkout@v3
with:
fetch-depth: '0'
- name: 💎 setup ruby & install dependencies
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0.2 # can change this to 2.7 or whatever version you prefer
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: 🔨 build site
run: JEKYLL_ENV=production bundle exec jekyll build
- name: 🚀 Deploy to Netlify CDN
uses: netlify/actions/cli@master
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
with:
args: deploy --dir=_site --prod --message="${{ github.ref_name }}@${{ github.sha }}"