Giter VIP home page Giter VIP logo

milanmk / actions-file-deployer Goto Github PK

View Code? Open in Web Editor NEW
62.0 2.0 13.0 36 KB

Composite GitHub Action (Linux runner) for deploying repository content to remote server. Fast and customizable deployment with proxy support. Deploy only changed files or do full sync/mirror of repository content.

License: The Unlicense

github-actions deployment-automation workflow-automation continuous-deployment github-workflow ftp-deploy ssh-deploy

actions-file-deployer's People

Contributors

djontleman avatar gbcreation avatar milanmk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

actions-file-deployer's Issues

Removing files and folders in delta mode doesn't work

Hey @milanmk,

Thanks for your work on this action! I needed to explore the possibility to deploy code over SSH so I stumbled upon this action, which works great, partly thanks to the delta/full sync switch, awesome!

1 thing I noticed tho, is that when you create a testfolder with one testfile in it, that gets added perfectly fine, but if you remove the file from the testfolder and remove the folder too, in your repo, the removal of both file and folder doesn't work.

Could you check that, please?

Thanks a lot!

// T

Change ".deploy-revision" path & delta synchronisation problem

Hey,

I have a question about upload synchronization. Indeed, I have an sFTP that looks like “/public_html” and “/private”. I don't have permission to create folders/files on the “/” root.

When I use your action, it creates a “.deploy-revision” even in “full” synchronization. The problem is that “.deploy-revision” tries to create itself at the root, so it would be interesting to be able to change the path of this file.

Additionally, if I use the delta synchronization action for the first time on a fresh SFTP, I encounter an error indicating that it is unable to "touch .deploy-revision". As a result, I am forced to set the synchronization to "full", which creates the file and allows the upload (I must admit that I do not understand why this is not done automatically in "delta").

That's all from me, thank you again for this action! Have a great day!

Webhook Support

Hi, I'm trying to use a webhook within the action to send notifications to a discord channel, and it does not appear to work.

The webhook looks like this:
https://canary.discord.com/api/webhooks/id/token

If I manually trigger the Action I receive the following two errors:

First:

Initialization
	Webhook notification (start): {"message": "Cannot send an empty message", "code": 50006}

Second:

Cleanup
	[...]
	Webhook notification (finish): {"repository": ["Expected an object/dictionary."]}

If I update a file and GitHub automatically triggers the Action I receive the following two errors:

First:

Initialization
	Webhook notification (start): {"message": "Cannot send an empty message", "code": 50006}

Second:

Cleanup
	[..]
	Webhook notification (finish): {"message": "Cannot send an empty message", "code": 50006}

Here is what my action.yml looks like:

name: Deploy Files

on:
  push:
    branches:
      - master
  # Enables manually triggering of Workflow with file synchronization option
  workflow_dispatch:
    inputs:
      sync:
        description: "🚚 File synchronization"
        required: true
        default: "delta"

jobs:
  deploy-master:
    name: "master branch"
    if: ${{ github.ref == 'refs/heads/master' }}
    runs-on: ubuntu-latest
    timeout-minutes: 30
    steps:
      - name: "Checkout"
        uses: actions/checkout@v3
        with:
          fetch-depth: 0
      - name: "Deploy"
        uses: milanmk/actions-file-deployer@master
        with:
          remote-protocol: "sftp"
          remote-host: "[...]" 
          remote-user: "[...]" 
          remote-password: ${{ secrets.password }}
          remote-path: "[...]"  
          webhook: "https://canary.discord.com/api/webhooks/id/token"

Any help is greatly appreciated,

Thank you!

Delta Syning combined with push action not working

My Workflow starts when I push to main, builds the project and pushes the artifact from the dest folder to the gh-pages branch.
Now I want to sync the gh-pages branch to my sftp server.
This does not work, as the sftp action gets the changes from the main branch not from the gh-pages branch.

When using the delta mode, the script still looks at the latest commit in the main branch not in the gh-pages branch, because the {{github.sha}} variable points to main, as main triggered the workflow.

The action should use git cli to determine the latest commit and not rely on the github context.

Example workflow:

on:
  push:
    branches:
      - main
jobs:
  build:
    runs-on: ubuntu-latest
    name: Build and Push
    steps:
      - name: git-checkout
        uses: actions/checkout@v2 
      - name: Build
        run: |
          build.sh
      - name: Push
        uses: s0/git-publish-subdir-action@develop
        env:
          REPO: self
          BRANCH: gh-pages
          FOLDER: dest/
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          MESSAGE: "Build: ({sha}) {msg}"

  deploy:
    runs-on: ubuntu-latest
    name: Deploy to FTP
    needs: build
    steps:
      - name: git-checkout
        uses: actions/checkout@v2 
        with:
          fetch-depth: 0
          ref: gh-pages
          
      - name: Sync to FTP server
        uses: milanmk/actions-file-deployer@master
        with:
          remote-protocol: sftp
          remote-host: ${{ secrets.FTP_HOST }}
          remote-user: ${{ secrets.FTP_USER }}
          remote-password: ${{ secrets.FTP_PASSWORD }}
          remote-path: /prod
          remote-port: ${{ secrets.FTP_PORT }}

Already tried putting the sftp action into another workflow which triggers on push to gh-pages, but a push by the GTIHUB_TOKEN credentials does not trigger workflows - i would have to use a PAT :(

With full sync, everything works, because no commit history is looked at and the {{ github.sha }} is not referenced

First sync not working.

I am trying to run this workflow. There are no errors being shown in github actions page, but in the log, it shows like this...

image

I tried running in delta mode first, and then in full mode. Same output in both.
BTW, the root directory is empty.
What to do ?
Any idea how to resolve this ?

Error "Git repository not found" with files in repository

I receive the following error:
Error: Git repository not found. Please ensure you have a checkout step before this step.

But I have a repository and files in it:

jobs:
  deploy-queue:
    name: Deployment
    runs-on: ubuntu-latest
    steps:
      - name: "Checkout Queue"
        uses: actions/checkout@v3
        with:
          path: "public_queue/**"
          fetch-depth: 0
      - name: "Checkout Shared"
        uses: actions/checkout@v3
        with:
          path: "shared/**"
          fetch-depth: 0
      - name: "Log Structure"
        run: |
          pwd
          tree
      - name: "Deploy Files"
        uses: milanmk/actions-file-deployer@master
        with:
          remote-protocol: "sftp"
          remote-host: ${{ secrets.SSH_QUEUE_HOST }}
          remote-user: ${{ secrets.SSH_QUEUE_USERNAME }}
          remote-password: ${{ secrets.SSH_QUEUE_PASSWORD }}
          ssh-private-key: ${{ secrets.SSH_QUEUE_PRIVATE_KEY }}
          remote-path: ${{ secrets.SSH_QUEUE_REMOTE_PATH }}
          sync: "full"

I can not figure out what the error refers to more specific. Hope you can help

.deploy-running: No such file or directory

I updated from 1.12 to 1.14 and saw this error:

Transfer files
  Protocol: sftp
  Synchronization: full
  Local path: asset
  Remote path: /asset
  ____________________________________________________________________________________________________
  put: /home/runner/work/something/something/.deploy-running: No such file or directory
  Error: Process completed with exit code 1.

I can see this commit in 1.13 updated the paths and I think this has introduced an issue. Reverting to 1.12 solved the problem.

mput: .deploy-revision: Fatal error: max-retries exceeded

Hello,
I am using this action to deploy to a production server which has SFTP access. But I am getting the following error:

Upload files: 0
Delete files: 0


**** Timeout - reconnecting
put: .deploy-running: Fatal error: max-retries exceeded
**** Timeout - reconnecting
**** Timeout - reconnecting
mput: .deploy-revision: Fatal error: max-retries exceeded
**** Timeout - reconnecting
**** Timeout - reconnecting

Could anybody give me any support regarding this issue.

Reporting a vulnerability

Hello!

I hope you are doing well!

We are a security research team. Our tool automatically detected a vulnerability in this repository. We want to disclose it responsibly. GitHub has a feature called Private vulnerability reporting, which enables security research to privately disclose a vulnerability. Unfortunately, it is not enabled for this repository.

Can you enable it, so that we can report it?

Thanks in advance!

PS: you can read about how to enable private vulnerability reporting here: https://docs.github.com/en/code-security/security-advisories/repository-security-advisories/configuring-private-vulnerability-reporting-for-a-repository

Permission denied (publickey)

Alongside SSH with keys (authentication with keys only).
I setup SFTP with users and passwords (no keys). I can login to SFTP by FileZilla with user and password and do not need keys.

          remote-host: "${{ secrets.HOST }}"
          remote-port: "${{ secrets.PORT }}"
          remote-user: "${{ secrets.USERNAME }}"
          remote-password: "${{ secrets.PASSWORD }}"

Actions shows error: Permission denied (publickey).

sync: "delta" shows in logs success but not uploading latest version of the file

Hi,

Could you please take a look a look? I'm using below parameters, and when I use sync: "delta" the latest files are not being uploaded, though shown in logs that file was uploaded. When I use sync: "full" - the all works fine as expected.

jobs:

  deploy-via-sftp:
    runs-on: ubuntu-latest
    steps:
      - name: "Checkout"
        uses: actions/checkout@v3
        with:
          fetch-depth: 0

      - name: SFTP Deploy
        uses: milanmk/actions-file-deployer@master
        with:
          remote-protocol: "sftp"
          remote-host: ""
          remote-user: ""
          remote-password: ""
          remote-path: "/wp-content/themes/mytheme"
          local-path: "./wp-content/themes/mytheme"
          sync: "delta"

No files are uploaded at all with sync option to "full". Logs show PUT/MIRROR failure.

Do the logs below can ring a bell to someone?
Also the path getting "*****" signs should be ignored? ( folder name is same as username )

image

yml file :


name: Deploy Files
on: [push]
jobs:

  deploy-master:
    name: "master branch"
    runs-on: ubuntu-latest
    timeout-minutes: 30
    steps:
      - name: "Checkout"
        uses: actions/checkout@v3
        with:
          fetch-depth: 0
      - name: "Deploy"
        uses: milanmk/actions-file-deployer@master
        with:
          remote-protocol: "sftp"
          remote-host: ${{ secrets.TESTSERV_SFTP_HOST }}  
          remote-user: ${{ secrets.TESTSERV_SFTP_USER }}
          remote-password: ${{ secrets.TESTSERV_SFTP_PASSPHRASE }}
          ssh-private-key: ${{ secrets.TESTSERV_SFTP_KEY }}   
          local-path: "."
          remote-path: "/lotsoffolders/franck/repofolder"
          sync: "full"
          debug: true

[BUG] No files were transferred: Peer closed connection

full sync with fetch-depth: 10 and delta sync with fetch-depth: 0 both dont transfer files.

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - name: Get Latest Code
        uses: actions/checkout@v4
        with:
          fetch-depth: 10
      - name: Sync Files
        uses: milanmk/actions-file-deployer@master
        with:
          remote-protocol: "ftp"
          remote-host: ${{ secrets.FTP_HOST }}
          remote-user: ${{ secrets.FTP_USERNAME }}
          remote-password: ${{ secrets.FTP_PASSWORD }}
          sync: full
          remote-path: "/choir-management/"
2024-06-21T11:21:38.9423824Z File created: /home/runner/.ssh/config
2024-06-21T11:21:38.9425004Z ____________________________________________________________________________________________________
2024-06-21T11:21:38.9437070Z File created: /home/runner/.netrc
2024-06-21T11:21:38.9438370Z ____________________________________________________________________________________________________
2024-06-21T11:21:38.9450857Z File created: ~/.lftprc
2024-06-21T11:21:38.9452405Z ##[endgroup]
2024-06-21T11:21:38.9471161Z ##[group]Prepare files
2024-06-21T11:21:38.9471956Z Event: push
2024-06-21T11:21:38.9473678Z Revision: https://github.com/xtay2/choir-management/commit/d553b6734be0b47a138e728ff72f307f152ebf72
2024-06-21T11:21:38.9475129Z Committer: xtay2
2024-06-21T11:21:38.9476168Z Message: Update deploy-to-acaunion.yml
2024-06-21T11:21:38.9477359Z ____________________________________________________________________________________________________
2024-06-21T11:21:38.9478513Z File created: ./.deploy-revision
2024-06-21T11:21:38.9479649Z d553b6734be0b47a138e728ff72f307f152ebf72
2024-06-21T11:21:38.9481724Z ____________________________________________________________________________________________________
2024-06-21T11:21:38.9483076Z ##[endgroup]
2024-06-21T11:21:38.9484048Z ##[group]Transfer files
2024-06-21T11:21:38.9484793Z Protocol: ftp
2024-06-21T11:21:38.9485443Z Synchronization: full
2024-06-21T11:21:38.9486107Z Local path: .
2024-06-21T11:21:38.9487027Z Remote path: /choir-management
2024-06-21T11:21:38.9487787Z ____________________________________________________________________________________________________
2024-06-21T11:21:39.3983528Z **** Peer closed connection
2024-06-21T11:21:39.3989756Z put: .deploy-running: Fatal error: max-retries exceeded
2024-06-21T11:21:39.6165835Z **** Peer closed connection
2024-06-21T11:21:54.8324765Z **** Peer closed connection
2024-06-21T11:21:54.8326501Z mirror: Fatal error: max-retries exceeded
2024-06-21T11:21:55.0483595Z **** Peer closed connection
2024-06-21T11:21:55.0494509Z ##[endgroup]
2024-06-21T11:21:55.0496015Z ##[group]Cleanup
2024-06-21T11:21:55.0512172Z removed '/home/runner/.netrc'
2024-06-21T11:21:55.0534493Z ##[endgroup]
2024-06-21T11:21:55.0605160Z ##[group]Run actions/upload-artifact@v4
2024-06-21T11:21:55.0605790Z with:
2024-06-21T11:21:55.0606099Z   name: transfer_artifacts
2024-06-21T11:21:55.0606612Z   path: ~/transfer_log.txt
~/transfer_files

2024-06-21T11:21:55.0607107Z   if-no-files-found: ignore
2024-06-21T11:21:55.0607496Z   compression-level: 6
2024-06-21T11:21:55.0607914Z   overwrite: false
2024-06-21T11:21:55.0608269Z ##[endgroup]
2024-06-21T11:21:55.2683274Z Multiple search paths detected. Calculating the least common ancestor of all paths
2024-06-21T11:21:55.2687231Z The least common ancestor is /home/runner. This will be the root directory of the artifact
2024-06-21T11:21:55.2689153Z No files were found with the provided path: ~/transfer_log.txt
2024-06-21T11:21:55.2690535Z ~/transfer_files. No artifacts will be uploaded.
2024-06-21T11:21:55.2844634Z Post job cleanup.
2024-06-21T11:21:55.3772508Z [command]/usr/bin/git version
2024-06-21T11:21:55.3812956Z git version 2.45.2
2024-06-21T11:21:55.3857125Z Temporarily overriding HOME='/home/runner/work/_temp/cf208901-c02a-4f06-ba5c-b76d3697a095' before making global git config changes
2024-06-21T11:21:55.3859936Z Adding repository directory to the temporary git global config as a safe directory
2024-06-21T11:21:55.3864319Z [command]/usr/bin/git config --global --add safe.directory /home/runner/work/choir-management/choir-management
2024-06-21T11:21:55.3909023Z [command]/usr/bin/git config --local --name-only --get-regexp core\.sshCommand
2024-06-21T11:21:55.3949877Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
2024-06-21T11:21:55.4213851Z [command]/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
2024-06-21T11:21:55.4237528Z http.https://github.com/.extraheader
2024-06-21T11:21:55.4251779Z [command]/usr/bin/git config --local --unset-all http.https://github.com/.extraheader
2024-06-21T11:21:55.4287423Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
2024-06-21T11:21:55.4764257Z Cleaning up orphan processes

Files over a certain size are only partially uploaded (FTP)

With every deployment action I run, any files over a certain size (seems to be 48 KiB) error with Fatal error: max-retries exceeded and the end result is that an incomplete file (48 KiB in size) is left on the server.

Here's the log from the last deployment.

It's just using FTP, not SFTP or FTPS. Normal FTP connections work absolutely fine.

Any ideas?

Protocol: ftp
  Synchronization: delta
  Local path: .
  Remote path: /public_html
  Upload files: 1
  Delete files: 0
  ____________________________________________________________________________________________________
  WARNING: Certificate verification: hostname checking disabled
  WARNING: Certificate verification: hostname checking disabled
  WARNING: Certificate verification: hostname checking disabled
  WARNING: Certificate verification: hostname checking disabled
  WARNING: Certificate verification: hostname checking disabled
  <--- 451-Error during read from data connection
  <--- 451-Transfer aborted
  <--- 451 0.212 seconds (measured here), 75.52 Kbytes per second
  WARNING: Certificate verification: hostname checking disabled
  <--- 451-Error during read from data connection
  <--- 451-Transfer aborted
  <--- 451 0.217 seconds (measured here), 73.84 Kbytes per second
  WARNING: Certificate verification: hostname checking disabled
  <--- 451-Error during read from data connection
  <--- 451-Transfer aborted
  <--- 451 0.217 seconds (measured here), 73.56 Kbytes per second
  mput: System/modules/appointments/lib/appointments.inc.php: Fatal error: max-retries exceeded
  /home/runner/work/[redacted]/[redacted]/.deploy-running -> ftp://***@***:21***.deploy-running 0-0 
  /home/runner/work/[redacted]/[redacted]/.deploy-revision -> ftp://***@***:21***.deploy-revision 0-41 54 B/s

Specifying local-path includes directory structure on upload

If I specify "local-path" as something other that ".", say "./src", it will copy the "src" folder along with the changed file to the remote path.

Example .yml:

remote-path/wp-content/themes/my-theme
local-path ./src

then if I change a file and push, say: sample.php

on upload, I will see:

index.php
about.php
src/

  • sample.php

desired effect:

index.php
about.php
sample.php

Not sure if it's a bug or a feature not implemented. But makes it difficult when remote and local directories don't match.

Include file to always sync

Hello,

If I change a file with my workflow, will this file be synced up? If not, how can I ensure this file is synced even if not in the git diff?

Unable to resolve host

Hi, does this work with ips? I added my server's ip and I get an error, here is the log and my yaml config:

Error:

Unknown command `3m9QFPN_EDPjQ@***'.
Transfer files
  Synchronization: full
  Local path: .
  Remote path: /somepath
  Protocol: SFTP
  __________________________________________________
  mirror: Fatal error: max-retries exceeded (Could not resolve hostname ***: Temporary failure in name resolution)
  Error: Process completed with exit code 1.

Yaml:

name: Deploy Files

on: push

jobs:
  master:
    name: master
    if: ${{ github.ref == 'refs/heads/master' }}
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Deploy
        uses: milanmk/actions-file-deployer@master
        with:
          remote-protocol: "sftp"
          remote-host: ${{ secrets.FTP_SERVER }}
          remote-user: ${{ secrets.FTP_USERNAME }}
          remote-password: ${{ secrets.FTP_PASSWORD }}
          remote-port: 22
          remote-path: "/somepath"

"no matching host key type found. Their offer: ssh-rsa" How do I solve this problem?

hello. I always appreciate your code.
Unfortunately the server I need to upload to via sftp is using the ssh-rsa keytype.
So, the error message "no matching host key type found. Their offer: ssh-rsa" is displayed. The same thing happens when I access it from my PC terminal.
To solve this, I need to explicitly write "-oHostKeyAlgorithms=+ssh-rsa" in the connection options. How can I write it using which item of the input parameter?
Reply please.

"full" uses different path than "delta"

After finally finding this action that works with sftp and covers all my usecases (and I love the fact that you can toggle whether to run a delta or full in a manual action) I've come across this issue:

It seems that the path is handled differently when using delta vs when using full.

I want to sync the top level folder ./datapacks in my repository with the remote folder /world/datapacks. Here is my config file:

name: Upload to FTP
on:
  push:
    branches: [ main ]
  workflow_dispatch:
    inputs:
      sync:
        description: "File synchronization ('delta' / 'full')"
        required: true
        default: delta
jobs:
  upload:
    name: Upload 🔼
    runs-on: ubuntu-latest
    steps:
      - name: Get latest code 👀
        uses: actions/checkout@v3
        with:
          fetch-depth: 0
      - name: Sync files 📁
        uses: milanmk/[email protected]
        with:
          remote-protocol: "sftp"
          remote-host: ${{ secrets.ftp_server }}
          remote-port: 2022
          remote-user: ${{ secrets.ftp_username }}
          remote-password: ${{ secrets.ftp_password }}
          local-path: "./datapacks"
          remote-path: "/world/datapacks"

When using full dispatch mode the files are created correctly:

/home/runner/work/TunnelRats/TunnelRats/datapacks/mappack/pack.mcmeta -> sftp://***@***:2022/world/datapacks/mappack/pack.mcmeta

However, when using delta, the files are put into an additional subfolder (world/datapacks/datapacks instead of world/datapacks).

/home/runner/work/TunnelRats/TunnelRats/datapacks/mappack/pack.mcmeta -> sftp://***@***:2022/world/datapacks/datapacks/mappack/pack.mcmeta

Did I configure something wrong or is this an issue with the pack?

Thank you for any info in advance :)

Another "full" sync works, "delta" doesn't issue

With a workflow like this:

jobs:
  deploy:
    name: Deploy to production
    runs-on: ubuntu-latest
    steps:
      - uses: actions/[email protected]
        with:
          fetch-depth: 0
          submodules: true
          ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}

      - uses: milanmk/[email protected]
        with:
          remote-host: ${{ secrets.REMOTE_HOST }}
          remote-user: ${{ secrets.REMOTE_USER }}
          remote-password: ${{ secrets.REMOTE_PASSWORD }}
          remote-path: "${{ vars.REMOTE_TARGET }}/test"
          local-path: "www/test"
          sync: "full"

When sync is set to "full", we get a run like this:

Run milanmk/[email protected]
  with:
    remote-host: ***
    remote-user: ***
    remote-password: ***
    remote-path: /home/***/public_html/test
    local-path: www/test
    sync: full
    remote-protocol: sftp
    remote-port: 22
    proxy: false
    proxy-port: 22
    proxy-forwarding-port: 1080
Run echo "::group::Initialization"
Initialization
  Check repository
  Initialize inputs
  Validate inputs
Install packages
  Selecting previously unselected package lftp.
  (Reading database ... 
  (Reading database ... 5%
  (Reading database ... 10%
  (Reading database ... 15%
  (Reading database ... 20%
  (Reading database ... 25%
  (Reading database ... 30%
  (Reading database ... 35%
  (Reading database ... 40%
  (Reading database ... 45%
  (Reading database ... 50%
  (Reading database ... 55%
  (Reading database ... 60%
  (Reading database ... 65%
  (Reading database ... 70%
  (Reading database ... 75%
  (Reading database ... 80%
  (Reading database ... 85%
  (Reading database ... 90%
  (Reading database ... 95%
  (Reading database ... 100%
  (Reading database ... 269551 files and directories currently installed.)
  Preparing to unpack .../lftp_4.9.2-1build1_amd64.deb ...
  Unpacking lftp (4.9.2-1build1) ...
  Setting up lftp (4.9.2-1build1) ...
  Processing triggers for mailcap (3.70+nmu1ubuntu1) ...
  Processing triggers for hicolor-icon-theme (0.17-2) ...
  Processing triggers for man-db (2.10.2-1) ...
  NEEDRESTART-VER: 3.5
  NEEDRESTART-KCUR: 6.5.0-1021-azure
  NEEDRESTART-KEXP: 6.5.0-1021-azure
  NEEDRESTART-KSTA: 1
Configurations
  File created: /home/runner/.ssh/config
  ____________________________________________________________________________________________________
  File created: /home/runner/.netrc
  ____________________________________________________________________________________________________
  File created: ~/.lftprc
Prepare files
  Event: pull_request
  Revision: [redacted]
  Committer: wtflm
  Message: 
  ____________________________________________________________________________________________________
  File created: www/test/.deploy-revision
  1c13a790c086eaa7e000d39e2ad36f02f258e4af
  ____________________________________________________________________________________________________
Transfer files
  Protocol: sftp
  Synchronization: full
  Local path: www/test
  Remote path: /home/***/public_html/test
  ____________________________________________________________________________________________________
  put: /home/runner/work/[redacted]/.deploy-running: No such file or directory
  /home/runner/work/[redacted]/www/test/.deploy-revision -> sftp://***@***:22/home/***/public_html/test/.deploy-revision 0-41 108 B/s
  /home/runner/work/[redacted]/www/test/another.file -> sftp://***@***:22/home/***/public_html/test/another.file 0-13 34 B/s
  /home/runner/work/[redacted]/www/test/nufile -> sftp://***@***:22/home/***/public_html/test/nufile 0-4 11 B/s
  /home/runner/work/[redacted]/www/test/test.txt -> sftp://***@***:22/home/***/public_html/test/test.txt 0-0 
  /home/runner/work/[redacted]/www/test/.deploy-running -> sftp://***@***:22/home/***/public_html/test/.deploy-running 0-0 
  /home/runner/work/[redacted]/www/test/.htaccess -> sftp://***@***:22/home/***/public_html/test/.htaccess 0-0 
Cleanup
  removed '/home/runner/.netrc'
  removed '/home/runner/transfer_log.txt'
Run actions/upload-artifact@v4
  with:
    name: transfer_artifacts
    path: ~/transfer_log.txt
  ~/transfer_files
  
    if-no-files-found: ignore
    compression-level: 6
    overwrite: false
Multiple search paths detected. Calculating the least common ancestor of all paths
The least common ancestor is /home/runner. This will be the root directory of the artifact
No files were found with the provided path: ~/transfer_log.txt
~/transfer_files. No artifacts will be uploaded.

After adding yet.another.file to www/test and changing to sync: "delta", this happens:

Run milanmk/[email protected]
  with:
    remote-host: ***
    remote-user: ***
    remote-password: ***
    remote-path: /home/***/public_html/test
    local-path: www/test
    sync: delta
    remote-protocol: sftp
    remote-port: 22
    proxy: false
    proxy-port: 22
    proxy-forwarding-port: 1080
Run echo "::group::Initialization"
Initialization
  Check repository
  Initialize inputs
  Validate inputs
Install packages
  Selecting previously unselected package lftp.
  (Reading database ... 
  (Reading database ... 5%
  (Reading database ... 10%
  (Reading database ... 15%
  (Reading database ... 20%
  (Reading database ... 25%
  (Reading database ... 30%
  (Reading database ... 35%
  (Reading database ... 40%
  (Reading database ... 45%
  (Reading database ... 50%
  (Reading database ... 55%
  (Reading database ... 60%
  (Reading database ... 65%
  (Reading database ... 70%
  (Reading database ... 75%
  (Reading database ... 80%
  (Reading database ... 85%
  (Reading database ... 90%
  (Reading database ... 95%
  (Reading database ... 100%
  (Reading database ... 269551 files and directories currently installed.)
  Preparing to unpack .../lftp_4.9.2-1build1_amd64.deb ...
  Unpacking lftp (4.9.2-1build1) ...
  Setting up lftp (4.9.2-1build1) ...
  Processing triggers for mailcap (3.70+nmu1ubuntu1) ...
  Processing triggers for hicolor-icon-theme (0.17-2) ...
  Processing triggers for man-db (2.10.2-1) ...
  NEEDRESTART-VER: 3.5
  NEEDRESTART-KCUR: 6.5.0-1021-azure
  NEEDRESTART-KEXP: 6.5.0-1021-azure
  NEEDRESTART-KSTA: 1
Configurations
  File created: /home/runner/.ssh/config
  ____________________________________________________________________________________________________
  File created: /home/runner/.netrc
  ____________________________________________________________________________________________________
  File created: ~/.lftprc
Prepare files
  Event: pull_request
  Revision: [redacted]
  Committer: wtflm
  Message: 
  ____________________________________________________________________________________________________
  File created: www/test/.deploy-revision
  210ee121f159a4ea7a86f6c249fb6595a5c52a59
  ____________________________________________________________________________________________________
  Previous Revision: [redacted]
  ____________________________________________________________________________________________________
  File created: ~/files_to_upload
  ____________________________________________________________________________________________________
  File created: ~/files_to_delete
  ____________________________________________________________________________________________________
Transfer files
  Protocol: sftp
  Synchronization: delta
  Local path: www/test
  Remote path: /home/***/public_html/test
  Upload files: 0
  Delete files: 0
  ____________________________________________________________________________________________________
  /home/runner/work/[redacted]/www/test/.deploy-running -> sftp://***@***:22/home/***/public_html/test/.deploy-running 0-0 
  /home/runner/work/[redacted]/www/test/.deploy-revision -> sftp://***@***:22/home/***/public_html/test/.deploy-revision 0-41 68 B/s
Cleanup
  removed '/home/runner/.netrc'
  removed '/home/runner/transfer_log.txt'
Run actions/upload-artifact@v4
  with:
    name: transfer_artifacts
    path: ~/transfer_log.txt
  ~/transfer_files
  
    if-no-files-found: ignore
    compression-level: 6
    overwrite: false
Multiple search paths detected. Calculating the least common ancestor of all paths
The least common ancestor is /home/runner. This will be the root directory of the artifact
No files were found with the provided path: ~/transfer_log.txt
~/transfer_files. No artifacts will be uploaded.

The goal is to upload only the newly added yet.another.file but for some reason, it gets overlooked and only .deploy-revision ends up in the target directory.

Exclude directories on full sync example

Hi.

first of all, thanks a lot for the great repo!

I am struggling with the syntax for excluding certain directories with the full sync.
I think that I should be using the ftp-mirror-options property. So far I have tried, without success, exclude, --exclude, --exclude-glob, --exclude-glob=.

Thanks a lot in advance for your support!

usr/bin/lftp: Argument list too long

Hi, i have this use. Please some body, can help me.

File created: ~/files_to_delete


Transfer files
Protocol: ftp
Synchronization: delta
Local path: src
Remote path: /home/runner/work/xxxxxxxxx/xxxxxxxxx
Upload files: 6525
Delete files: 0


/home/runner/work/_temp/1873f9b5-963e-4a6a-9944-c7d3d6933d02.sh: line 293: /usr/bin/lftp: Argument list too long
Error: Process completed with exit code 126.

File deployer failing silently.

The action status is green, but I get this in the logs:

Protocol: ftp
Synchronization: full
Local path: .
Remote path: /home/wellnessfromfood/DeploymentTest1


**** Peer closed connection
put: .deploy-running: Fatal error: max-retries exceeded
**** Peer closed connection
**** Peer closed connection
mirror: Fatal error: max-retries exceeded
**** Peer closed connection

Any clues?

No files were ever uploaded, as far as I can find on the destination server.

Enable Security Advisories / Security Contact

Hello,

I would like to report a security vulnerability in private, I was not able to find a security contact for this repository and there is no security policy and private reporting is disabled as well. What would be a good contact to reach out to? Or would you be open to enabling private vulnerability reporting for the repository?

Question: How best to verify uploaded files?

I am using this action to perform an SFTP upload and have seen an issue where a connection problem resulted in 0 byte files existing on the FTP server.

I would like to add some verification to the file upload so that I can be 100% sure that all files have been uploaded completely. What is the best way to achieve this?

I have considered some options already:

  1. Input artifacts: true and compare the content of the generated transfer_log.txt file to the files on the local disk.
  2. Input ftp-options: 'set xfer:verify true' to run a verify command. I'm not sure if this is doing anything as I don't see anything additional in the log output with this enabled.
  3. After the upload has completed, download all files from the FTP server and compare with the files on the local disk to check that they match. I haven't yet found a GitHub Action to do SFTP download....

I'm interested in any other suggestions, thanks.

can't upload files or folders into path with special characters like [ ]

Hey, when i'm trying to commit files into folders with special characters
i've got this

  mput: resources/[standalone]/[phone]/lb-phone_prop/.fxap: no files found
  mput: resources/[standalone]/[phone]/lb-phone_prop/fxmanifest.lua: no files found
  mput: resources/[standalone]/[phone]/lb-phone_prop/stream/lb_phone_prop.ydr: no files found
  mput: resources/[standalone]/[phone]/lb-phone_prop/stream/lbphone_props.ytyp: no files found

here is my workflow

name: 🚀 Développement - Star'Island
on:
  push:
    branches: [dev]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/[email protected]
        with:
          ref: ${{ github.ref }}
          fetch-depth: 0

      - name: Deploy to SFTP
        uses: milanmk/[email protected]
        with:
          remote-protocol: sftp
          remote-host: ${{ secrets.SFTP_HOST }}
          remote-port: 2022
          remote-user: ${{ secrets.SFTP_DEV_USER }}
          remote-password: ${{ secrets.SFTP_PASSWORD }}
          local-path: ./
          remote-path: /
          sync: delta
          debug: true

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.