Created
February 22, 2020 11:29
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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