I’ve recently started using GitHub Actions to run tests for a few of my projects.

This blog post will show how I deploy my Jekyll sites, built on Jekyll, to an SCP server, in my example, my Freethought account.

Here is my actions file:

.github/workflows/build.yml

name: Build
on:
  push:
    branches:
    - master

jobs:
  build:
    name: Build & Deploy
    runs-on: ubuntu-20.04

    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Setup Ruby and install gems
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: 2.7
          bundler-cache: true

      - name: Setup Node
        uses: actions/setup-node@v2
        with:
          node-version: 14
          cache: 'yarn'

      - name: Install packages
        run: yarn install

      - name: Build Jekyll Site
        env:
          JEKYLL_ENV: production
          NODE_ENV: production
        run: bundle exec jekyll build

      - name: Deploy
        uses: SamKirkland/[email protected]
        with:
          server: my-server.com
          protocol: ftps
          username: username
          password: $
          local-dir: ./_site/
          server-dir: ./