Gastby js deployment to SSH server using Github action.

This is a simple code snippet that shows how you can deploy you Gatsby.js application to an SSH server using Github actions.

Create a main.yaml in your .github/workflow

name: blog
on:
push:
branches: main
jobs:
build-and-deploy:
name:…


This content originally appeared on DEV Community and was authored by es404020

This is a simple code snippet that shows how you can deploy you Gatsby.js application to an SSH server using Github actions.

Create a main.yaml in your .github/workflow


name: blog
on:
  push:
    branches: main
jobs:
  build-and-deploy:
    name: Build and deploy Gatsby site
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Code
        uses: actions/checkout@v2.3.1

      - name: Install Node.js
        uses: actions/setup-node@v1
        with:
          node-version: '13.x'

      - name: Install Project Dependencies
        run: npm install

      - name: Install Gatsby CLI
        run: npm install -g gatsby-cli@2.12.34

      - name: Build
        run: gatsby build --prefix-paths

      - name: Verify build
        run: ls -la public

      - name: copy file via ssh key
        uses: appleboy/scp-action@master
        env:
          HOST:  
          PORT:  
          USERNAME:  
          PASSWORD: 
        with:
          source: "./public"
          target: "/var/www/html/blog"
          strip_components: 2 # this is important







This content originally appeared on DEV Community and was authored by es404020


Print Share Comment Cite Upload Translate Updates
APA

es404020 | Sciencx (2021-08-18T06:50:51+00:00) Gastby js deployment to SSH server using Github action.. Retrieved from https://www.scien.cx/2021/08/18/gastby-js-deployment-to-ssh-server-using-github-action/

MLA
" » Gastby js deployment to SSH server using Github action.." es404020 | Sciencx - Wednesday August 18, 2021, https://www.scien.cx/2021/08/18/gastby-js-deployment-to-ssh-server-using-github-action/
HARVARD
es404020 | Sciencx Wednesday August 18, 2021 » Gastby js deployment to SSH server using Github action.., viewed ,<https://www.scien.cx/2021/08/18/gastby-js-deployment-to-ssh-server-using-github-action/>
VANCOUVER
es404020 | Sciencx - » Gastby js deployment to SSH server using Github action.. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/08/18/gastby-js-deployment-to-ssh-server-using-github-action/
CHICAGO
" » Gastby js deployment to SSH server using Github action.." es404020 | Sciencx - Accessed . https://www.scien.cx/2021/08/18/gastby-js-deployment-to-ssh-server-using-github-action/
IEEE
" » Gastby js deployment to SSH server using Github action.." es404020 | Sciencx [Online]. Available: https://www.scien.cx/2021/08/18/gastby-js-deployment-to-ssh-server-using-github-action/. [Accessed: ]
rf:citation
» Gastby js deployment to SSH server using Github action. | es404020 | Sciencx | https://www.scien.cx/2021/08/18/gastby-js-deployment-to-ssh-server-using-github-action/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.