Skip to content

Update github workflow actions #204

Update github workflow actions

Update github workflow actions #204

name: Jekyll to FTP CI
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: 🛎 Check out master
uses: actions/checkout@v4
with:
fetch-depth: 1
# Use GitHub Actions' cache to shorten build times and decrease load on servers
- name: 📁 Init gem cache
uses: actions/cache@v1
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
- name: 🎩 Install Jekyll
run: |
sudo gem install bundler -v "$(grep -A 1 "BUNDLED WITH" Gemfile.lock | tail -n 1)"
bundle config path vendor/bundle
bundle install
- name: 🧹 Clean site
run: |
if [ -d "_site" ]; then
rm -rf _site/*
fi
- name: 🔨 Build site
run: bundle exec jekyll build --config _config.yml,_config_production.yml
- name: 🚀 Deploy
uses: SamKirkland/FTP-Deploy-Action@v4.3.5
with:
server: ${{secrets.FTP_SERVER}}
username: ${{secrets.FTP_USERNAME}}
password: ${{secrets.FTP_PASSWORD}}
local-dir: ./_site/