Skip to content
chevrons-up

GitHub Action

Build and Deploy Jekyll via SSH

v0.1 Latest version

Build and Deploy Jekyll via SSH

chevrons-up

Build and Deploy Jekyll via SSH

๐Ÿ’พ A Github Action to build and then deploy your Jekyll site via SSH

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Build and Deploy Jekyll via SSH

uses: YakGalaxy/[email protected]

Learn more about this action in YakGalaxy/jekyll-SSH-deploy-action

Choose a version

Jekyll SSH Deploy Action

A GitHub Action for building and deploying your Jekyll site via SSH.

Actions Status

Usage

  1. Create a GitHub workflow file (e.g. .github/workflows/SSH-deploy-action.yml) as per [here.](https://github.com/YakGalaxy/jekyll-SSH-deploy-action/blob/main/SSH-deploy-action.yml
  2. Ensure your source and target values are correct within your new SSH-deploy-action.yml file.
  3. Create your HOST , USERNAME and PASSWORD secrets within your repository on Github.com (your-repository/settings/secrets/actions).
  4. Push your 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

Credits

Contributing

Issues and Pull Requests are greatly appreciated.

You can start by opening an issue describing the problem that you're looking to resolve and we'll go from there.

License

This software is licensed under the MIT license.