From 9c9bf58a3897c9227bf7508cb7ef0bb925254dfb Mon Sep 17 00:00:00 2001 From: SEBASTIAN JN Date: Sat, 9 Sep 2023 13:59:43 -0300 Subject: [PATCH] update action.yml --- action.yml | 69 ------------------------------------------------------ 1 file changed, 69 deletions(-) diff --git a/action.yml b/action.yml index 050e53b..e69de29 100644 --- a/action.yml +++ b/action.yml @@ -1,69 +0,0 @@ -name: ssh-action-deploy -description: "Deploy has never been so easy, running commands has never been simpler..." -author: "sebastianjnuwu" -branding: - icon: "terminal" - color: "purple" - -inputs: - IP: - description: "A unique identifier for a device on the Internet or a local network." - required: true - USER: - description: "An agent, which can be a human or software agent, using a computer or network service." - required: true - PASSWORD: - description: "Password to use if SSH key is not provided." - required: false - KEY: - description: "A component of the Secure Shell protocol suite used to establish secure shell sessions between remote computers over insecure networks, using cryptographic techniques." - required: false - REPO: - description: "The name of the repository where the action is located (default: the GitHub repository)." - default: ${{ github.repository }} - FOLDER: - description: 'The name of the folder where files are located, including the user (e.g., "/user/deploy").' - required: true - RUN: - description: "Commands to be executed after the deploy (optional)." - required: false - -runs: - using: "composite" - steps: - - name: 🗿 Creating ssh files... - run: | - mkdir -p ~/.ssh/ - if [[ -n "${{ inputs.KEY }}" ]]; then - echo "${{ inputs.KEY }}" > ~/.ssh/ssh.key - chmod 600 ~/.ssh/ssh.key - elif [[ -n "${{ inputs.PASSWORD }}" ]]; then - echo "PasswordAuthentication yes" > ~/.ssh/config - echo "${{ inputs.PASSWORD }}" > ~/.ssh/password.txt - fi - shell: bash - - name: ✨ Removing old files... - run: | - if [[ -n "${{ inputs.KEY }}" ]]; then - ssh ssh rm -rf "${{ inputs.FOLDER }}"; - elif [[ -n "${{ inputs.PASSWORD }}" ]]; then - sshpass -p "$(cat ~/.ssh/password.txt)" ssh ${{ inputs.USER }}@${{ inputs.IP }} rm -rf "${{ inputs.FOLDER }}"; - fi - shell: bash - - name: 💧 deploy to vps... - run: | - cd .. - IN="${{ inputs.REPO }}" - set -- "$IN" - IFS="/"; declare -a Array=($*) - scp -r ${Array[1]} ssh:/${{ inputs.FOLDER }} - shell: bash - - name: 🍷 Executing commands... - if: ${{ inputs.RUN }} - run: | - if [[ -n "${{ inputs.KEY }}" ]]; then - ssh ssh "${{ inputs.RUN }}" - elif [[ -n "${{ inputs.PASSWORD }}" ]]; then - sshpass -p "$(cat ~/.ssh/password.txt)" ssh ${{ inputs.USER }}@${{ inputs.IP }} "${{ inputs.RUN }}" - fi - shell: bash