Giter VIP home page Giter VIP logo

web-deploy's Issues

rsync-option --ignore not working

rsync-options: --include not working.

I try to exclude all files by --exclude=* except wp-content/themes folder and files in it by:

--exclude=/* --include=/wp-content/ --include=/wp-content/themes/**

Extra Comment "--exclude-from"

Can you perhaps add in the option to specify "--exclude-from" within the rsync and all excludes will be stored in a separate file?

Please create option to prevent the Known hosts list warning

Bug Description
Not really a bug but i want to be able to supress the :

Warning: Permanently added 'xx.xxx.xxx.xx' (ED25519) to the list of known hosts. from the output in the actions

dont have branch rights so this can be the solution:

actions.yml:

inputs:
suppress-ssh-warning:
description: "Set to true to suppress SSH known hosts warning"
required: false
default: 'false'

main:

suppress_ssh_warning: getInput("suppress-ssh-warning") === 'true'

and

(create if statement)

let sshOptions = -e 'ssh -p ${args.ssh_port} -i ${privateKeyPath} -o StrictHostKeyChecking=no';
if (args.suppress_ssh_warning) {
sshOptions = -e 'ssh -p ${args.ssh_port} -i ${privateKeyPath} -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=ERROR';
}

Missing required input "source-path"

Bug Description
When I open my workflow file than there is linting error, displaying, that there is a missing required input, although the source-path shouldn't be required

My Action Config

on:
  # Triggers the workflow on push or pull request events but only for the "main" branch
  #   push:
  #     branches: ["main"]
  #   pull_request:
  #     branches: ["main"]

  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:
jobs:
  web-deploy:
    name: ๐ŸŽ‰ SSH-Deploy
    runs-on: ubuntu-latest
    steps:
      - name: ๐Ÿšš Get latest code
        uses: actions/checkout@v3

      - name: ๐Ÿ’ป Setup Node.js
        uses: actions/setup-node@v3
        with:
          node-version: 18

      - name: ๐Ÿ“ฅ Install dependencies
        run: npm ci

      - name: ๐Ÿ”จ Build Project
        run: npm run production

      - name: ๐Ÿ“‚ Sync files
        # https://github.com/SamKirkland/web-deploy
        uses: SamKirkland/web-deploy@v1
        with:
          target-server: ${{ secrets.SSH_SERVER }}
          remote-user: ${{ secrets.SSH_USERNAME }}
          private-ssh-key: ${{ secrets.SSH_KEY }}
          ssh-port: 22
          destination-path: ./www/public_html/
          rsync-options: >
            --dry-run
            --archive
            --verbose
            --compress
            --delete-after
            --human-readable
            --exclude-from=.github/workflows/deploy/rsync-exclude.txt

Here is a screenshot:
image

OPenSSL3 - ssh-rsa

Hi,

I'm using OpenSSH_8.9p1 Ubuntu-3ubuntu0.1, OpenSSL 3.0.2 15 Mar 2022
This version doesn't allow the usage of rsa keys (auth.log : userauth_pubkey: key type ssh-rsa not in PubkeyAcceptedAlgorithms [preauth])
I can't provide an ED25519 key because it is clearly written in the specs it has to be a RSA key.
I tried allowing rsa temporarily to see if it works, unfortunately it didn't. Either way I wouldn't like to use something not secure enough. It would be better if there was a way to use ED25519 keys.
Is that possible somehow?

Thanks

web-deploy not working: Unable to resolve action `SamKirkland/[email protected]`, unable to find version `1.0.0`

The output of update main.yml:

Current runner version: '2.275.1'
Operating System
Ubuntu
18.04.5
LTS
Virtual Environment
Environment: ubuntu-18.04
Version: 20201210.0
Included Software: https://github.com/actions/virtual-environments/blob/ubuntu18/20201210.0/images/linux/Ubuntu1804-README.md
Prepare workflow directory
Prepare all required actions
Getting action download info
Failed to resolve action download info. Error: Unable to resolve action SamKirkland/[email protected], unable to find version 1.0.0
Retrying in 24.817 seconds
Failed to resolve action download info. Error: Unable to resolve action SamKirkland/[email protected], unable to find version 1.0.0
Retrying in 12.956 seconds
Error: Failed to resolve action download info.

Content of my main.yaml:

on: push
name: Publish Website
jobs:
web-deploy:
name: ๐Ÿš€ Deploy website every commit
runs-on: ubuntu-latest
steps:
- name: ๐Ÿšš Get latest code
uses: actions/[email protected]

- name: ๐Ÿ“‚ Sync files
  uses: SamKirkland/[email protected]
  with:
    target-server: sftp.beautique-in.nl
    remote-user: 346741
    remote-key: ${{ secrets.ftp_password }}
    rsync-options: --dry-run --insecure

Case sensitive file detection

Dear Sam Kirkland and/or collaborators,

suggestion/feature request:

When calculating diff betwen local and server, if I renamed a file from:
fileFavorite.ext

to :
fileFAVORITE.ext

the action currently does not recognize the change and leaves the previous file (fileFavorite.ext).

โ†“ this file was renamed to clientesTABLA.php but this did not recognize the change
image

It would be great if by default it is not case sensitive (as I think it is right now), and and option to make it case sensitive, so in my case when deploying the first file would be overwritten with the new file.

Thank you for studying this suggestion.
I am very grateful for your effort and this GitHub Action.
best regards
Josepe

Load key "/home/runner/.ssh/web_deploy_key": invalid format

Bug Description
A clear and concise description of what the bug is.

My Action Config

on: push
name: Publish Website Dry Run
jobs:
  web-deploy:
    name: ๐Ÿš€ Deploy Website Every Commit
    runs-on: ubuntu-latest
    if: ${{ contains(github.event.head_commit.message, '#prod') }}
    steps:
      - name: ๐Ÿšš Get Latest Code
        uses: actions/checkout@v3

      - name: ๐Ÿ“‚ Sync Files
        uses: SamKirkland/web-deploy@v1
        with:
          target-server: #######pl
          remote-user: ##########
          private-ssh-key: ${{ secrets.SSH_DEV }}
          ssh-port: 22
          destination-path: ~/public_html/schody/
          rsync-options: --dry-run --archive --verbose --compress --delete-after --human-readable --exclude=.git* --exclude=.git/ --exclude=README.md --exclude=readme.md --exclude=.gitignore

My Action Log

   Run SamKirkland/web-deploy@v1
----------------------------------------------------------------
๐Ÿš€ Thanks for using web deploy. Let's deploy some stuff!
----------------------------------------------------------------
If you found this project helpful, please support it
by giving it a โญ on Github --> https://github.com/SamKirkland/web-deploy
or add a badge ๐Ÿท๏ธ to your projects readme --> https://github.com/SamKirkland/web-deploy#badge
----------------------------------------------------------------
HOME /home/runner
GITHUB_WORKSPACE /home/runner/work/schody/schody
[SSH] Creating /home/runner/.ssh/known_hosts file in  /home/runner/work/schody/schody
โœ… [SSH] file created.
โœ… Ssh key added to `.ssh` dir  /home/runner/.ssh/web_deploy_key
/usr/bin/rsync -e ssh -p 22 -i /home/runner/.ssh/web_deploy_key -o StrictHostKeyChecking=no --dry-run --archive --verbose --compress --delete-after --human-readable --exclude=.git* --exclude=.git/ --exclude=README.md --exclude=readme.md --exclude=.gitignore ./ [email protected]:~/public_html/schody/
<Buffer 57 61 72 6e 69 6e 67 3a 20 50 65 72 6d 61 6e 65 6e 74 6c 79 20 61 64 64 65 64 20 27 61 6c 6c 73 65 6e 73 65 73 2e 70 6c 2c 39 34 2e 31 35 32 2e 31 38 ... 44 more bytes>
Warning: Permanently added 'allsenses.pl,94.152.181.235' (ECDSA) to the list of known hosts.
<Buffer 4c 6f 61 64 20 6b 65 79 20 22 2f 68 6f 6d 65 2f 72 75 6e 6e 65 72 2f 2e 73 73 68 2f 77 65 62 5f 64 65 70 6c 6f 79 5f 6b 65 79 22 3a 20 69 6e 76 61 6c ... [11](https://github.com/allsensesdev/schody/actions/runs/3330115080/jobs/5508178259#step:3:12) more bytes>
Load key "/home/runner/.ssh/web_deploy_key": invalid format
<Buffer 61 6c 6c 73 65 6e 73 65 73 64 65 76 40 61 6c 6c 73 65 6e 73 65 73 2e 70 6c 3a [20](https://github.com/allsensesdev/schody/actions/runs/3330115080/jobs/5508178259#step:3:21) 50 65 72 6d 69 73 73 69 6f 6e 20 64 65 6e 69 65 64 20 28 70 75 62 6c ... 30 more bytes>
[email protected]: Permission denied (publickey,keyboard-interactive).
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
<Buffer 72 73 79 6e 63 3a 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 75 6e 65 78 70 65 63 74 65 64 6c 79 20 63 6c 6f 73 65 64 20 28 30 20 62 79 74 65 73 20 72 65 63 ... 93 more bytes>
rsync error: unexplained error (code 255) at io.c([23](https://github.com/allsensesdev/schody/actions/runs/3330115080/jobs/5508178259#step:3:24)5) [sender=3.1.3]
Error: Error: The process '/usr/bin/rsync' failed with exit code [25](https://github.com/allsensesdev/schody/actions/runs/3330115080/jobs/5508178259#step:3:26)5
โœ… Deploy Complete

Permission denied (publickey,password)

Bug Description
I have tried several different attempts at generating SSH keys (both via github and from cpanel), both fail to connect via web-deploy action. When I try it from my local PC to connect, it's totally fine and authenticates. I have also added the public SSH key to github.

My Action Config

on:
  push:
    branches:
      - dev
name: Publish Dev Branch to CPanel
jobs:
  web-deploy:
    name: ๐Ÿš€ Deploy Website to Dev
    runs-on: ubuntu-latest
    steps:
    - name: ๐Ÿšš Get Latest Code
      uses: actions/checkout@v3

    - name: ๐Ÿ“ฆ Install Packages
      uses: actions/setup-node@v3
      with:
        node-version: 16
        cache: "npm"
    - run: npm ci
      
    - name: ๐Ÿ”จ Build
      run: npm run build
    
    - name: ๐Ÿ“‚ Sync Files
      uses: SamKirkland/web-deploy@v1
      with:
        target-server: ############
        remote-user:  ######
        private-ssh-key: ${{ secrets.SSH_KEY }}
        destination-path: ~/home/###/###/repositories/####/
        ssh-port: 722

My Action Log

   Run SamKirkland/web-deploy@v1
----------------------------------------------------------------
๐Ÿš€ Thanks for using web deploy. Let's deploy some stuff!
----------------------------------------------------------------
If you found this project helpful, please support it
by giving it a โญ on Github --> https://github.com/SamKirkland/web-deploy
or add a badge ๐Ÿท๏ธ to your projects readme --> https://github.com/SamKirkland/web-deploy#badge
----------------------------------------------------------------
HOME /home/runner
GITHUB_WORKSPACE /home/runner/work/###/
[SSH] Creating /home/runner/.ssh/known_hosts file in  /home/runner/work/kitt-front/kitt-front
โœ… [SSH] file created.
โœ… Ssh key added to `.ssh` dir  /home/runner/.ssh/web_deploy_key
/usr/bin/rsync -e ssh -p 722 -i /home/runner/.ssh/web_deploy_key -o StrictHostKeyChecking=no --archive --verbose --compress --human-readable --progress --delete-after --exclude=.git* --exclude=.git/ --exclude=README.md --exclude=readme.md --exclude=.gitignore ./ #####@#####:~/home/#####/#####/####/#####/
<Buffer 57 61 72 6e 6[9](https://github.com/####/#####/actions/runs/4136808053/jobs/7151168830#step:6:10) 6e 67 3a 20 50 65 72 6d 61 6e 65 6e 74 6c 79 20 61 64 64 65 64 20 27 5b 66 65 72 67 75 73 2d 6c 6f 6e 32 2e 6b 72 79 73 74 61 6c 2e 75 ... 47 more bytes>
Warning: Permanently added '[####]:722' (ED25519) to the list of known hosts.
<Buffer 4c 6f 61 64 20 6b 65 79 20 22 2f 68 6f 6d 65 2f 72 75 6e 6e 65 72 2f 2e 73 73 68 2f 77 65 62 5f 64 65 70 6c 6f 79 5f 6b 65 79 22 3a 20 65 72 72 6f 72 ... [15](https://github.com/###/##/actions/runs/4136808053/jobs/7151168830#step:6:16) more bytes>
Load key "/home/runner/.ssh/web_deploy_key": error in libcrypto
<Buffer 50 65 72 6d 69 73 73 69 6f 6e [20](https://github.com/#####/####/actions/runs/4136808053/jobs/7151168830#step:6:21) 64 65 6e 69 65 64 2c 20 70 6c 65 61 73 65 20 74 72 79 20 61 67 61 69 6e 2e 0d 0a>
Permission denied, please try again.
<Buffer 50 65 72 6d 69 73 73 69 6f 6e 20 64 65 6e 69 65 64 2c 20 70 6c 65 61 73 65 20 74 72 79 20 61 67 61 69 6e 2e 0d 0a>
Permission denied, please try again.
<Buffer 6b 69 74 74 6d 65 64 69 40 66 65 72 67 75 73 2d 6c 6f 6e 32 2e 6b 72 79 73 74 61 6c 2e 75 6b 3a 20 50 65 72 6d 69 73 73 69 6f 6e 20 64 65 6e 69 65 64 ... 24 more bytes>
<Buffer 72 73 79 6e 63 3a 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 75 6e 65 78 70 65 63 74 65 64 6c 79 20 63 6c 6f 73 65 64 20 28 30 20 62 79 74 65 73 20 72 65 63 ... 93 more bytes>
#####@fergus-lon2.krystal.uk: Permission denied (publickey,password).
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c([22](https://github.com/####/####/actions/runs/4136808053/jobs/7151168830#step:6:23)8) [sender=3.2.3]
Error: Error: The process '/usr/bin/rsync' failed with exit code [25](https://github.com/####/###/actions/runs/4136808053/jobs/7151168830#step:6:26)5
โœ… Deploy Complete

Add password field

Hello!
If there any way to add the password field to the component, because my ISP provider provides only ssh ftp access with a username and password?
Thank you.

Web-deploy keeps deleting manually created files and folders

Bug Description
Whenever I run the web-deploy action in my server, all files and folders that does not exist in the git repo are automatically deleted from the server.

For example, I have a file .env and this file is not included in the github repo, but whenever I run the deploy script, it is automatically deleted from the server. Same goes for folders which are created manually in the server.

My Action Config

on:
    push:
        branches:
            - production
name: ๐Ÿš€ Deploy files to the production server on push to production branch
jobs:
    deploy:
        name: ๐ŸŽ‰ Deploy files
        runs-on: ubuntu-latest
        steps:
            - name: ๐Ÿšš Get latest code
              uses: actions/checkout@v4

            - name: Setup PHP ๐Ÿ˜
              uses: shivammathur/setup-php@v2
              with:
                php-version: 8.2

            - name: Cache Composer Packages ๐Ÿ“ฆ
              id: composer-cache
              uses: actions/cache@v3
              with:
                path: vendor
                key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
                restore-keys: |
                    ${{ runner.os }}-php-

            - name: Install Dependencies ๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ
              run: composer install --no-progress --no-interaction --prefer-dist --optimize-autoloader

            - name: ๐Ÿ“‚ Sync files
              uses: SamKirkland/web-deploy@v1
              with:
                target-server: example.com
                remote-user: ${{ secrets.do_sftp_username }}
                private-ssh-key: ${{ secrets.do_application_ssh_key }}
                destination-path: ~/public_html/
                source-path: ./
                ssh-port: 22
                rsync-options: --archive --verbose --compress --delete-after --human-readable --exclude=.git* --exclude=.git/ --exclude=README.md --exclude=readme.md --exclude=.gitignore --exclude "misc/" --exclude "src/" --exclude "*.txt"

What could be the problem?

Permissions for web_deploy_key are too open

Bug Description
I have stored the ss_key as a secret. When its copied to the file, I get the following error:

Permissions for 'D:\a\_actions\SamKirkland\web-deploy\v1\dist\.ssh\web_deploy_key' are too open.

My Action Config

  deploy:
    runs-on: windows-latest
    needs: build
    steps:
    - name: Install Rsync
      run: choco install rsync
    - name: Rsync version 
      run: gh version
    - name: webDeploy
      uses: SamKirkland/web-deploy@v1
      with:
        target-server: *******
        remote-user: **********
        private-ssh-key: ${{ secrets.SSH_KEY }}
        destination-path: ~/GitActionTest/

My Action Log

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
<Buffer 40 20 20 20 20 20 20 20 20 20 57 41 52 4e 49 4e 47 3a 20 55 4e 50 52 4f 54 45 43 54 45 44 20 50 52 49 56 41 54 45 20 4b 45 59 20 46 49 4c 45 21 20 20 ... 72 more bytes>
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
<Buffer 50 65 72 6d 69 73 73 69 6f 6e 73 20 66 6f 72 20 27 44 3a 5c 5c 61 5c 5c 5f 61 63 74 69 6f 6e 73 5c 5c 53 61 6d 4b 69 72 6b 6c 61 6e 64 5c 5c 77 65 62 ... 56 more bytes>
Permissions for 'D:\\a\\_actions\\SamKirkland\\web-deploy\\v1\\dist\\.ssh\\web_deploy_key' are too open.
<Buffer 49 74 20 69 73 20 72 65 71 75 69 72 65 64 20 74 68 61 74 20 79 6f 75 72 20 70 72 69 76 61 74 65 20 6b 65 79 20 66 69 6c 65 73 20 61 72 65 20 4e 4f 54 ... 24 more bytes>
It is required that your private key files are NOT accessible by others.
<Buffer 54 68 69 73 20 70 72 69 76 61 74 65 20 6b 65 79 20 77 69 6c 6c 20 62 65 20 69 67 6e 6f 72 65 64 2e 0d 0a>
This private key will be ignored.
<Buffer 4c 6f 61 64 20 6b 65 79 20 22 44 3a 5c 5c 61 5c 5c 5f 61 63 74 69 6f 6e 73 5c 5c 53 61 6d 4b 69 72 6b 6c 61 6e 64 5c 5c 77 65 62 2d 64 65 70 6c 6f 79 ... 52 more bytes>
Load key "D:\\a\\_actions\\SamKirkland\\web-deploy\\v1\\dist\\.ssh\\web_deploy_key": bad permissions
************************: Permission denied (publickey,keyboard-interactive).
<Buffer 72 73 79 6e 63 3a 20 5b 73 65 6e 64 65 72 5d 20 73 61 66 65 5f 72 65 61 64 20 66 61 69 6c 65 64 20 74 6f 20 72 65 61 64 20 [34](***************/job/18949547901#step:4:35) 20 62 79 74 65 73 3a 20 ... 31 more bytes>
rsync: [sender] safe_read failed to read 4 bytes: Connection reset by peer (104)
<Buffer 72 73 79 6e 63 20 65 72 72 6f 72 3a 20 65 72 72 6f 72 20 69 6e 20 72 73 79 6e 63 20 70 72 6f 74 6f 63 6f 6c 20 64 61 74 61 20 73 74 72 65 61 6d 20 28 ... [37](https://github.com/****************/actions/runs/6963609545/job/18949547901#step:4:38) more bytes>
rsync error: error in rsync protocol data stream (code 12) at io.c(282) [sender=3.2.7]
Error: Error: The process 'C:\ProgramData\Chocolatey\bin\rsync.exe' failed with exit code 12

configuration example

My Action Config

on:
  push:
  - name: ๐Ÿ“‚ Sync Files
      uses: SamKirkland/web-deploy@v1
      with:
        target-server: ${{ secrets.server}}
        remote-user: ${{ secrets.user}}
        private-ssh-key: ${{ secrets.SSH_KEY }}
        ssh-port: ${{ secrets.port}}
        destination-path: ~/core/
        rsync-options: --delete-after --human-readable --exclude=.git* --exclude=.git/ --exclude=README.md --exclude=readme.md --exclude=.gitignore --exclude=public/uploads/*

It works when uploading to the server but rsync removes the folders vendor and .env how can these 2 things not be deleted on the server?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.