Skip to content

Instantly share code, notes, and snippets.

@yvesh
Created February 22, 2020 11:29
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yvesh/17a8f7d3fcc79d0d9211cadd77cbc94f to your computer and use it in GitHub Desktop.
Save yvesh/17a8f7d3fcc79d0d9211cadd77cbc94f to your computer and use it in GitHub Desktop.
[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