Skip to content

Instantly share code, notes, and snippets.

@muhammadwafi
Created April 22, 2024 17:38
Show Gist options
  • Save muhammadwafi/54adcc250b0818a75e863495f63f919a to your computer and use it in GitHub Desktop.
Save muhammadwafi/54adcc250b0818a75e863495f63f919a to your computer and use it in GitHub Desktop.
Github action to deploy code on Kinsta through SFTP
name: Deploy code to kinsta
on:
push:
branches:
- main
workflow_dispatch:
inputs:
sync:
description: 'File synchronization'
required: true
default: 'full'
jobs:
production:
name: 🚀 Deploy on production
if: github.ref_name == 'main'
runs-on: ubuntu-latest
steps:
- name: Get latest production code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Sync production files
uses: milanmk/actions-file-deployer@master
with:
remote-protocol: 'sftp'
remote-host: ${{ secrets.YOUR_KINSTA_SERVER }}
remote-port: ${{ secrets.YOUR_KINSTA_PORT }}
remote-user: ${{ secrets.YOUR_KINSTA_USERNAME }}
remote-password: ${{ secrets.YOUR_KINSTA_PASSWORD }}
remote-path: ${{ secrets.YOUR_KINSTA_DIR }}
sync: 'full' # (full, delta)
debug: false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment