DEV Community

Discussion on: Dockerized Next.js on SSH server using Github Action.

Collapse
 
aeshevch profile image
Александр Шевченко • Edited

Greetings! I do everything according to your instructions, but I get an error at the "copy file via ssh key" stage

Image description

If I run deploy.sh manually on the server, it works fine..

.github/workflows/docker.yml:

name: client
on:
  push:
    branches: master
jobs:
  build-and-deploy:
    name: Build and deploy next 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: '14.x'

      - name: Install Project Dependencies
        run: npm install



      - name: Build
        run: npm run build



      - name: copy file via ssh key
        uses: appleboy/scp-action@master
        env:
          HOST:  92.255.108.95
          PORT:  22
          USERNAME:  root
          PASSWORD: ******
          command_timeout: 100m
          script: sh deploy.sh
Enter fullscreen mode Exit fullscreen mode
Collapse
 
aeshevch profile image
Александр Шевченко

hm.. Looks like appleboy/scp-action@master has no script option

Collapse
 
es404020 profile image
es404020

It has a script option