Skip to content

Instantly share code, notes, and snippets.

@yvesh
Created Feb 22, 2020
Embed
What would you like to do?
[GitHub Action] Publish Gatsby website to an Linux SFTP (scp) server on PUSH
name: Publish a gatsby project with SFTP
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build project
run: |
sudo npm install -g gatsby-cli
yarn
gatsby build
- name: Publish to server via scp
uses: appleboy/scp-action@master
with:
host: ${{ secrets.HOST }}
port: ${{ secrets.PORT }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.KEY }}
passphrase: ${{ secrets.PASSPHRASE }}
source: "public/*"
target: "/var/www/whatever/vhost"
overwrite: 1
strip_components: 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment