A GitHub Action for building and deploying your Jekyll site via SSH.
.github/workflows/SSH-deploy-action.yml
) as per [here.](https://github.com/YakGalaxy/jekyll-SSH-deploy-action/blob/main/SSH-deploy-action.ymlSSH-deploy-action.yml
file. HOST
, USERNAME
and PASSWORD
secrets within your repository on Github.com (your-repository/settings/secrets/actions)
. SSH-deploy-action.yml
file to your repository's main
branch.name: Build and Deploy Jekyll via SSH
description: 💾 A Github Action to build and then deploy your Jekyll site via SSH
on:
workflow_dispatch: # Allows workflow to be run manually
push:
branches:
- main # Or your default branch
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: 💎 Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2.3' # Adjust as needed for your project
- name: 🏗️ Build Jekyll site
run: |
bundle install
bundle exec jekyll build
- name: 🚀 Deploy via SSH
uses: appleboy/scp-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
port: ${{ secrets.PORT }}
source: "./_site/*" # Adjust if required
target: "/public_html" # Set to your deployment directory (for example /public_html)
strip_components: 1 # This ensures that a subdirectory is not created
Issues and Pull Requests are welcomed!
This software is licensed under the MIT license.