site/.github/workflows/gatsby.yml
2021-10-31 12:46:45 +03:00

32 lines
760 B
YAML

name: Publish a gatsby project with SCP
on:
push:
branches:
- master
workflow_dispatch:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build project
run: |
sudo yarn global add 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.WEBMASTER_USERNAME }}
password: ${{ secrets.WEBMASTER_PASSWORD }}
# key: ${{ secrets.NPM_GITHUB_PRIVATE_KEY }}
source: "public/*"
target: "/home/webmaster/html"
overwrite: 1
strip_components: 1