Find a file
2024-12-12 22:16:06 -06:00
.dockerignore refactor(docker): Reduce docker image final size 2020-06-05 18:29:58 -03:00
.gitignore refactor(docker): Reduce docker image final size 2020-06-05 18:29:58 -03:00
action.yml Update action.yml 2024-12-11 18:55:42 -06:00
Dockerfile fix(docker): Fix install scp command in container 2020-06-05 18:48:26 -03:00
entrypoint.sh fix rm when none 2024-12-12 22:16:06 -06:00
LICENSE Initial commit 2020-06-01 22:52:18 -03:00
README.md Add parameter for extra options 2021-05-06 19:03:27 +02:00

SSH-SCP Deploy action

Action to send dist files to a remote server with scp command

Required params

  • src: Source dir to deploy
  • host: SSH address
  • remote: Remote dir path
  • port: SSH Port
  • user: SSH User name
  • key: Private key
  • options : Extra options for scp

To publish

You must generate the ssh key and publish the public pair on your host. On git secrets, publish your private key

Ex.:

ssh-keygen -t rsa -b 4096 -f ssh_publish -C <some@name>

Example

This is a nuxt universal application

name: MasterCI

on:
  push:
    branches:
      - master

jobs:
  build:
    runs-on: ubuntu-latest
    name: Build and Deploy

    steps:
      - uses: actions/checkout@master

      - name: Bucket actions
        uses: actions/setup-node@v1
        with:
          node-version: 8
      - run: npm i
      - run: npm run test
      - run: npm run generate
      
      - name: Publish
        uses: nogsantos/scp-deploy@master
        with:
          src: ./dist/*
          host: ${{ secrets.SSH_HOST }}
          remote: ${{ secrets.SSH_DIR }}
          port: ${{ secrets.SSH_PORT }}
          user: ${{ secrets.SSH_USER }}
          key: ${{ secrets.SSH_KEY }}