ssh-action-deploy
"What you were looking for all this time to be here, deploy your application"
Deploy your application to vps over ssh quickly and easily using github actions...
- Deploy your application
- Execute commands
- Easy and fast
- Authenticate with an ssh key or with a password
Worth remembering if you have any questions or suggestions just open an issue.
Read this before running ssh-action-deploy
β’ During deploy the folder you put in is cleaned.
β’ We use the default ssh port (22) to execute the deploy
β’ If you want to use several commands, separate them with & or ;.
β’ You must provide one authentication method: KEY (private key) or PASSWORD. If both are provided, KEY is used first and PASSWORD as fallback.
β’ The password mode uses sshpass, which is installed automatically on the runner (apt, apk, dnf, yum or brew).
It is very simple to use, see the example:
# Please read the next section below before using for your own safety "variables".
name: π₯ ssh-action-deploy
on:
push:
branches: [ "action" ]
pull_request:
branches: [ "action" ]
jobs:
build:
name: π³οΈ Ubuntu...
runs-on: ubuntu-latest
steps:
- name: π Github actions...
uses: actions/checkout@v3
- name: π Deploy with ssh...
uses: sebastianjnuwu/ssh-action-deploy@v5
with:
IP: ${{ secrets.IP }}
USER: ${{ secrets.USER }}
KEY: ${{ secrets.KEY }}
FOLDER: "/root/.deploy"
RUN: "ls -a; pwd"Only the authentication changes: drop KEY and use PASSWORD.
- name: π Deploy with ssh password...
uses: sebastianjnuwu/ssh-action-deploy@v5
with:
IP: ${{ secrets.IP }}
USER: ${{ secrets.USER }}
PASSWORD: ${{ secrets.PASSWORD }}
FOLDER: "/root/.deploy"
RUN: "ls -a; pwd"The password is passed to
sshpassthrough theSSHPASSenvironment variable (not on the command line), so it does not show up in the process list.
| variable | example | require |
|---|---|---|
IP |
1.1.1.1 |
true |
USER |
root |
true |
KEY |
xxxxxx |
false (required if PASSWORD is empty) |
PASSWORD |
xxxxxx |
false (required if KEY is empty) |
FOLDER |
/root/.deploy |
true |
RUN |
uptime |
false |