GitHub Action for publish your app via SSH and execute commands.
See action.yml for more detailed information.
HOST
- SSH remote hostPORT
- SSH protocol port, default is22
USERNAME
- SSH usernamePASSWORD
- Password of ssh userSOURCE
- Folder to be transferredDESTINATION
- Destination of source file as archive on remote hostSCRIPTS
- Execute commands after transfer source file
on: [push]
jobs:
deployment_job:
runs-on: ubuntu-latest
name: Deployment Job
steps:
- uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 16
- name: npm install, build, and test
run: |
npm install
npm run build --if-present
- name: SSH
uses: ErenKrt/ssh-push@main
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
source: "./dist"
destination: "/home/eren/web.zip"
#scripts: |
# rm -r /home/eren/erencandev && mkdir /home/eren/erencandev
# cd /home/eren/erencandev && mv /home/eren/web.zip . &&
# unzip web.zip && rm -r web.zip
# rm -r /home/eren/erencandev/node_modules
# sudo -s && cd /home/eren/erencandev/ && npm i
# pm2 restart 1