From e0df1dfe572a999c17ac0f51ec44b77f49b894db Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Sun, 28 Mar 2021 22:38:22 +0300 Subject: [PATCH] Create gatsby.yml --- .github/workflows/gatsby.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/gatsby.yml diff --git a/.github/workflows/gatsby.yml b/.github/workflows/gatsby.yml new file mode 100644 index 0000000..63fed35 --- /dev/null +++ b/.github/workflows/gatsby.yml @@ -0,0 +1,34 @@ +name: Publish a gatsby project with SCP +on: + push: + branches: + - master + pull_request: + branches: + - master + workflow_dispatch: + branches: + - master + +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: "/home/webmaster/html" + overwrite: 1 + strip_components: 1