Build and deploy jekyll site to Netlify #2011
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 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 }}" |