Giter Site home page Giter Site logo

samkirkland / ftp-deploy-action Goto Github PK

View Code? Open in Web Editor NEW
3.4K 26.0 357.0 747 KB

Deploys a GitHub project to a FTP server using GitHub actions

License: MIT License

TypeScript 100.00%
action deployment-automation deploy-action actions github-actions continuous-deployment continuous-integration

ftp-deploy-action's People

Contributors

apokalyptik avatar cafca avatar clarkchentw avatar dependabot[bot] avatar fabiankaegy avatar filiptronicek avatar helias avatar marvimoto avatar mikeybinns avatar misiu avatar samkirkland avatar tflight avatar the-snowwhite avatar trainax avatar unverbraucht avatar wcoder 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ftp-deploy-action's Issues

Is the .git folder necessary on the FTP server?

I'm wondering if the .github and .git folders are required to be uploaded to the FTP server?
For example are they used at all to monitor which files to update or delete on the server end.

If they are not used would you be able to provide an example of how to exclude multiple filers/folders using --exclude-glob=GP please.

TLS insecure and other flags not working

Hello I'm trying to use some "set" commands on the runtime of lftp to ignore TLS issues on the remote destination (not under my control to actually fix the server)
Example:

      uses: SamKirkland/[email protected]
      env:
        FTP_SERVER: ${{ secrets.FTP_SERVER }}
        FTP_USERNAME: ${{ secrets.FTP_USERNAME }}
        FTP_PASSWORD: ${{ secrets.FTP_PASSWORD }}
        LOCAL_DIR: src
        ARGS: "-e 'set ssl:verify-certificate false; set ftp:ssl-force true; set ftp:ssl-protect-data true'"

As expected this fails, how is best to pass this over? could I use an .lftprc file in the repo for example?

Thanks

Is SFTP supported?

Greetings,

Is SFTP supported for this github action?

Thanks,

SGTGunner

Connection closed without reason

Hey,

I wanted to use this action but i encountered a problem. For information: i am using sftp, i know the username and password are correct and i am unsure of the port and host. Sometimes the run fails at the connection part and sometimes it doesn't (see images). I ran this action on my local computer and it works 100% of the time i run it. I hoped maybe someone encountered the same issue and someone knows how to fix this.

Thanks,

Bram

Failed run
Screenshot 2019-11-07 at 16 08 44

Same run that i rechecked
Screenshot 2019-11-07 at 16 14 10

Make auto-init optional

While --auto-init flag can be useful given the lack of integrity guarantees in FTP, it can also be burden for bigger projects as re-uploading everything for every deploy can take a lot of time.

Also git-ftp stores the latest git SHA on the server to keep track of files which were/weren't uploaded - so re-uploading the whole hierarchy seems to be defeating the purpose of using that tool (as opposed to some generic FTP client).

Is there any chance of making the auto-init optional?

Uploading all files by default

For some reason all my files are being updated whether they have changed in github or not.
I added --verbose to check and everything gets deleted then transferred. I thought the default was to now only upload changed files?

I'm using the following ARGS. Would you be able to explain if I have something wrong. I thought I had to have --transfer-all in order to do what it is currently doing.

ARGS: --exclude=.ftpquota --exclude-glob=.git*/** --exclude-glob=.git** --no-empty-dirs --verbose

Many thanks

Syncronization of subdir "lib" fails

Bug Description
If I try to sync a project with a subdirectory called lib, the deployment will fail.

My Action Config

on:
  push:
    branches:
      - master
name: Publish Website over SFTP
jobs:
  FTP-Deploy-Action:
    name: FTP-Deploy-Action
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
      
    - name: FTP Deploy
      uses: SamKirkland/[email protected]
      env:
        FTP_SERVER: 
        FTP_USERNAME: 
        FTP_PASSWORD: 
        METHOD: sftp
        PORT: 22
        LOCAL_DIR: public
        ARGS: --delete --transfer-all --no-empty-dirs

My Action Log

   mirror: Access failed: No such file (/lib)

Workaround
Rename the directory "lib" to "libs" and everything works fine.

dist folder not uploaded

Bug Description

I want to use this action for uploading the resulting folder of npm run build which is a dist folder in root. My workflow properly builds it and listing the folders shows it's correct, but then the build folder is not uploaded to SFTP as intended.

I might be mistaken but I think this has to do with it using git-ftp under the hood now since v3?
Which I think checks which files have been changed and committed?

The thing is, I have the /dist/ folder in my .gitignore, because I don't want to have that folder be part of my version control, because it isn't source code. It's production / distribution code, only to be built when I push something new to master, and then to be deployed on my server.

My Action Config

on:
  push:
    branches:
      - master
name: Publish Website
jobs:
  FTP-Deploy-Action:
    name: FTP-Deploy-Action
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
      with:
        fetch-depth: 2

    - name: Use Node.js 12.x
      uses: actions/setup-node@v1
      with:
        node-version: '12.x'

    - name: Build Project
      run: |
        npm install
        npm run build --if-present

    - name: List output files
      run: ls

    - name: List dist files
      run: cd dist && ls

    - name: FTP-Deploy-Action
      uses: SamKirkland/[email protected]
      with:
        ftp-server: sftp://188.166.61.51
        ftp-username: joren
        ftp-password: ${{ secrets.FTP_PASSWORD }}
        git-ftp-args: --insecure --remote-root home/joren/yc-bank-frontend --all
        local-dir: dist

I put the --all flag just to see if it would help but it doesn't.

My Action Log

     Wed Feb 19 20:47:47 UTC 2020: The remote sha1 is saved in file '.git-ftp.log'.
  Wed Feb 19 20:47:47 UTC 2020: Check if curl is functional.
  Wed Feb 19 20:47:47 UTC 2020: Retrieving last commit from sftp://joren:***@188.166.61.51/home/joren/yc-bank-frontend/.
  #=#=#                                                                         
  ##O#- #                                                                       
  ##O=#  #                                                                      
  #=#=-#  #                                                                     
  -#O#- #   #                                                                   
  -=#=#   #   #                                                                 
  -=O#- #  #    #                                                               
  -=O=#  #   #   #                                                              
  
  ######################################################################## 100.0%
  Wed Feb 19 20:47:50 UTC 2020: Taking all files.
  Wed Feb 19 20:47:50 UTC 2020: No files to sync. All changed files ignored.
  Wed Feb 19 20:47:50 UTC 2020: There are no files to sync.
  Wed Feb 19 20:47:50 UTC 2020: Uploading commit log to sftp://joren:***@188.166.61.51/home/joren/yc-bank-frontend/.git-ftp.log.
  #=#=#                                                                         
  ##O#- #                                                                       
  ##O=#  #                                                                      
  #=#=-#  #                                                                     
  -#O#- #   #                                                                   
  -=#=#   #   #                                                                 
  -=O#- #  #    #                                                               
  -=O=#  #   #   #                                                              
  -=O=-#  #    #   #                                                            
  Wed Feb 19 20:47:52 UTC 2020: Last deployment changed from aadf920b6030699d9137fe1d56d497a8bed7021e to 7462f39642bea68d75e12f8d05a102afeea457b2.
✅ Deploy Complete

I wasn't sure if the above is the action log you meant, let me know if you need more info.

Here's the repo btw: https://github.com/jorenbroekema/yc-bank-frontend/

Build script only fires when created

I commit .github/workflows/main.workflow

workflow "ftp deploy" {
  resolves = ["FTP-Deploy-Action"]
  on = "push"
}

action "FTP-Deploy-Action" {
  uses = "SamKirkland/FTP-Deploy-Action@master"
  secrets = ["GITHUB_TOKEN", "FTP_SERVER", "FTP_PASSWORD", "FTP_USERNAME", "LOCAL_DIR", "REMOTE_DIR"]
}

But it only starts when I commit the script. Not on each push?

SFTP -- curl: (60) SSL peer certificate or SSH remote key was not OK

Bug Description
When using a remote SSH/SFTP server you should be able to connect without resorting to --insecure. However, because it is not possible to populate a ~/.ssh/known_hosts file, --insecure seems to be the only thing that works.

My Action Config
basic sftp:// deploy config against an ssh server

My Action Log
Relevant parts below

2020-03-25T20:21:04.8987537Z Wed Mar 25 20:21:04 UTC 2020: Retrieving last commit from sftp://[user]:***@[hostname]/.
2020-03-25T20:21:05.0644146Z #=#=#                                                                         
2020-03-25T20:21:05.0649243Z curl: (60) SSL peer certificate or SSH remote key was not OK
2020-03-25T20:21:05.0649592Z More details here: https://curl.haxx.se/docs/sslcerts.html
2020-03-25T20:21:05.0649719Z 
2020-03-25T20:21:05.0649870Z curl failed to verify the legitimacy of the server and therefore could not
2020-03-25T20:21:05.0650029Z establish a secure connection to it. To learn more about this situation and
2020-03-25T20:21:05.0650177Z how to fix it, please visit the web page mentioned above.
2020-03-25T20:21:05.0676312Z Wed Mar 25 20:21:05 UTC 2020: Check if sftp://[user]:***@[hostname]is accessible.

I would imagine that it should be possible, and relatively easy?, to populate a ~/.ssh/known_hosts file from data provided in main.yml and that would alleviate this problem completely

Deploy to Azure failed - MFF and SITE CHMOD are not supported by this site

I have a very simple action that deploys the content of the build folder to Azure FTP.

- name: FTP Deploy to Azure
  uses: SamKirkland/[email protected]
  env: 
   FTP_SERVER: ${{ secrets.FTP_SERVER_AZURE_TEST }}
   FTP_USERNAME: ${{ secrets.FTP_USERNAME_AZURE_TEST }}
   FTP_PASSWORD: ${{ secrets.FTP_PASSWORD_AZURE_TEST }}
   REMOTE_DIR: site/wwwroot
   LOCAL_DIR: build
   METHOD: ftp
   ARGS: --no-empty-dirs --delete --ignore-time --verbose --continue

Unfortunately, I get these errors when Actions run:

Transferring file `PHPMailer/SMTP.php'
chmod: Access failed: 500 'SITE': command not understood (./Exception.php)
chmod: Operation not supported: MFF and SITE CHMOD are not supported by this site
chmod: Operation not supported: MFF and SITE CHMOD are not supported by this site
chmod: Operation not supported: MFF and SITE CHMOD are not supported by this site
chmod: Operation not supported: MFF and SITE CHMOD are not supported by this site
Making directory `kontakt'
Removing old file `kontakt/index.html'
Transferring file `kontakt/index.html'
chmod: Operation not supported: MFF and SITE CHMOD are not supported by this site
Making directory `not-found'
Removing old file `not-found/index.html'
Transferring file `not-found/index.html'
chmod: Operation not supported: MFF and SITE CHMOD are not supported by this site

The same action works fine when I deploy to OVH, but on Azure, I get the above errors.

Does anyone have an idea what might be wrong?

Clear remote folder before or after deploy

Hi there,
I recently starder using Your action. After couple of tries, I got it working.
I use react and when creating build js files are minified and hash is added to names (to prevent cache problems). When deploying multiple times I end up with one working js file and couple of outdated files (because they stay on the server).
Ideally, I'd like to remove old files after deploy, but this would involve listing files on FTP, then listing files in build directory and deleting only those that didn't change on deploy, but easier solution would be to add option that will allow deleting all files (and folders) in remote directory before deploy (upload) starts.
Please consider adding this feature.

v3 not uploading any files

Bug Description
I cannot get it to upload any files when using v3.
v2 works great.

I have a nuxt app that I first build / generate and then want to upload the dist files.
The nuxt/dist/ directory (which contains the generated files that should be uploaded) is empty in my repo and gets filled during the generate step.

My Action Config

name: Deploy to Server

on: [push]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
      
    - uses: actions/checkout@master
      with:
        fetch-depth: 2
    - name: Use Node.js 10.x
      uses: actions/setup-node@v1
      with:
        node-version: 10.x

    - name: Install npm dependencies
      run: npm ci
      working-directory: ./nuxt

    - name: Generate nuxt app
      run: npm run generate && ls -l dist/
      working-directory: ./nuxt

    - name: Deploy to FTP
      uses: SamKirkland/[email protected]
      with:
        FTP_SERVER: ${{ secrets.FTP_SERVER }}
        FTP_USERNAME: ${{ secrets.FTP_USERNAME }}
        FTP_PASSWORD: ${{ secrets.FTP_PASSWORD }}
        LOCAL_DIR: nuxt/dist

My Action Log

The log starts with the directory listing at the end of stepp "Generate nuxt app" - that would be the files that need to be uploaded.

2020-02-19T07:36:25.6855059Z -rw-r--r-- 1 runner docker  3584 Feb 19 07:36 200.html
2020-02-19T07:36:25.6855828Z -rw-r--r-- 1 runner docker   435 Feb 19 07:36 README.md
2020-02-19T07:36:25.6856745Z drwxr-xr-x 3 runner docker  4096 Feb 19 07:36 _nuxt
2020-02-19T07:36:25.6857368Z -rw-r--r-- 1 runner docker  1393 Feb 19 07:36 favicon.ico
2020-02-19T07:36:25.6857884Z -rw-r--r-- 1 runner docker 12699 Feb 19 07:36 icon.png
2020-02-19T07:36:25.6858414Z -rw-r--r-- 1 runner docker  5138 Feb 19 07:36 index.html
2020-02-19T07:36:25.6858930Z -rw-r--r-- 1 runner docker   995 Feb 19 07:36 sw.js
2020-02-19T07:36:25.7065144Z ##[group]Run SamKirkland/[email protected]
2020-02-19T07:36:25.7065281Z with:
2020-02-19T07:36:25.7065717Z   ftp-server: ***
2020-02-19T07:36:25.7065968Z   ftp-username: ***
2020-02-19T07:36:25.7066120Z   ftp-password: ***
2020-02-19T07:36:25.7066217Z   local-dir: nuxt/dist
2020-02-19T07:36:25.7066315Z ##[endgroup]
2020-02-19T07:36:25.7091823Z ##[command]/usr/bin/docker run --name e87b5214e197375c4c41d4848da5bf6c35ced1_5bdb6c --label e87b52 --workdir /github/workspace --rm -e INPUT_FTP-SERVER -e INPUT_FTP-USERNAME -e INPUT_FTP-PASSWORD -e INPUT_LOCAL-DIR -e INPUT_GIT-FTP-ARGS -e HOME -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e GITHUB_ACTIONS=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/nuxt-actions-starter/nuxt-actions-starter":"/github/workspace" e87b52:14e197375c4c41d4848da5bf6c35ced1
2020-02-19T07:36:32.6177059Z ##[group]Uploading files
2020-02-19T07:36:32.6205728Z [command]git ftp push --force --auto-init --verbose --syncroot nuxt/dist --user *** --passwd *** ***
2020-02-19T07:36:32.6380416Z Wed Feb 19 07:36:32 UTC 2020: git-ftp version 1.5.1 running on Linux fe536c023aab 5.0.0-1031-azure #33-Ubuntu SMP Thu Feb 6 22:26:13 UTC 2020 x86_64 GNU/Linux
2020-02-19T07:36:32.6380665Z Wed Feb 19 07:36:32 UTC 2020: Forced mode enabled.
2020-02-19T07:36:32.6380865Z Wed Feb 19 07:36:32 UTC 2020: Auto init if needed.
2020-02-19T07:36:32.6404687Z Wed Feb 19 07:36:32 UTC 2020: Using syncroot nuxt/dist if exists.
2020-02-19T07:36:32.6859517Z Wed Feb 19 07:36:32 UTC 2020: Host is '***'.
2020-02-19T07:36:32.6869996Z Wed Feb 19 07:36:32 UTC 2020: User is '***'.
2020-02-19T07:36:32.6902666Z Wed Feb 19 07:36:32 UTC 2020: Password is set.
2020-02-19T07:36:32.6955616Z Wed Feb 19 07:36:32 UTC 2020: CACert is ''.
2020-02-19T07:36:32.6990568Z Wed Feb 19 07:36:32 UTC 2020: Insecure is '0'.
2020-02-19T07:36:32.7037587Z Wed Feb 19 07:36:32 UTC 2020: Proxy is ''.
2020-02-19T07:36:32.7095137Z Wed Feb 19 07:36:32 UTC 2020: Protocol not set, using default protocol ftp://.
2020-02-19T07:36:32.7144358Z Wed Feb 19 07:36:32 UTC 2020: Path is ''.
2020-02-19T07:36:32.7174846Z Wed Feb 19 07:36:32 UTC 2020: Syncroot is 'nuxt/dist/'.
2020-02-19T07:36:32.7207604Z Wed Feb 19 07:36:32 UTC 2020: The remote sha1 is saved in file '.git-ftp.log'.
2020-02-19T07:36:32.7219907Z Wed Feb 19 07:36:32 UTC 2020: Check if curl is functional.
2020-02-19T07:36:32.7312207Z Wed Feb 19 07:36:32 UTC 2020: Retrieving last commit from ftp://***:***@***/.
2020-02-19T07:36:32.9381498Z #=#=#                                                                         
2020-02-19T07:36:33.1271264Z ##O#- #                                                                       
2020-02-19T07:36:33.3446146Z ##O=#  #                                                                      
2020-02-19T07:36:33.5317988Z #=#=-#  #                                                                     
2020-02-19T07:36:33.7187990Z -#O#- #   #                                                                   
2020-02-19T07:36:33.9063575Z -=#=#   #   #                                                                 
2020-02-19T07:36:33.9063751Z 
2020-02-19T07:36:33.9064058Z ######################################################################## 100.0%
2020-02-19T07:36:34.0081190Z Wed Feb 19 07:36:34 UTC 2020: Unknown SHA1 object, could not determine changed files, taking all files.
2020-02-19T07:36:34.0114752Z Wed Feb 19 07:36:34 UTC 2020: No files to sync. All changed files ignored.
2020-02-19T07:36:34.0128108Z Wed Feb 19 07:36:34 UTC 2020: There are no files to sync.
2020-02-19T07:36:34.0143167Z Wed Feb 19 07:36:34 UTC 2020: Uploading commit log to ftp://***:***@***/.git-ftp.log.
2020-02-19T07:36:34.2285280Z #=#=#                                                                         
2020-02-19T07:36:34.4164336Z ##O#- #                                                                       
2020-02-19T07:36:34.6340493Z ##O=#  #                                                                      
2020-02-19T07:36:34.8210987Z #=#=-#  #                                                                     
2020-02-19T07:36:35.0078690Z -#O#- #   #                                                                   
2020-02-19T07:36:35.1959372Z -=#=#   #   #                                                                 
2020-02-19T07:36:35.1960195Z -=O#- #  #    #                                                               
2020-02-19T07:36:35.2915372Z Wed Feb 19 07:36:35 UTC 2020: Last deployment changed from d47023f9a64196661463328f32be24d54f651ef0 to 4acf835b1700e378dbfe94fd5589356c4aa54514.
2020-02-19T07:36:35.2963181Z ##[endgroup]

tl;dr: error always says "No files to sync. All changed files ignored." 🤷🏻‍♂️

Don't know if it's a bug or I am doing something wrong.

Thanks for help.
Aaron

LFS Objects are not being copied

Hi,

thanks for this great Action!

I have a repository with GIT LFS Objects (https://git-lfs.github.com/).

But the LFS files (for example MP4-Videos) are not transfered via FTP, but the references,
which are basically textfiles.

Is it possible that this action will also transfer the bigger files?

Local dir set, but parent folders are still being uploaded

My understanding is that local-dir is syncroot from git-ftp. syncroot should set the repository root to that folder. I have an Angular project which builds to ./wv8-finance-front-end/dist/.

Therefore, I've added the folder to the include file:
!wv8-finance-front-end/dist/

And set the local-dir to:
./wv8-finance-front-end/dist/.

When uploading I'd expect the files in the dist folder to be uploaded to the root of my specified path. Sadly both folders (wv8-finance-front-end/dist) are being uploaded with the files in the dist folder. I need the files to be in the root folder.

Am I doing something wrong? Thanks in advance.

Excluding files does not work

I seem to be having trouble excluding files from the upload.

What I'd like to exclude is the .git and .github folders, as well as .htaccess. I also want to upload only the files that were changed in the commit. For the former I did as the Readme suggested, and the latter looks like it should be the default behavior now.

However, the action keeps uploading all of the files - even those I wanted to exclude, and even those that weren't changed.

Here's what my main.yml looks like:

on: push
name: Publish Website
jobs:
  fTP-Deploy-Action:
    name: FTP-Deploy-Action
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - name: FTP-Deploy-Action
      uses: SamKirkland/FTP-Deploy-Action@master
      env:
        FTP_PASSWORD: ${{ secrets.FTP_PASSWORD }}
        FTP_SERVER: ${{ secrets.FTP_SERVER }}
        FTP_USERNAME: ${{ secrets.FTP_USERNAME }}
        ARGS: --exclude-glob=**/.git*/** --exclude-glob=**/.git** --exclude-glob=**/.htaccess

I also tried --exclude=.git, --exclude=.htaccess and --only-newer at various points, with no apparent effect.

There's probably something I'm doing wrong as I have no experience with lftp, but so far I'm clueless to what it could be.

Thanks for making this by the way, it's really helpful!

Can not find build directory.

I am trying to make a react app build and deploy with FTP to another server.
The connection is working correctly with server but the build directory can not be found.
I have create a LOCAL_DIR secret variable but not working.
My deploy.yml file looks like this:

name: Build and Publish Website
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
    - name: Project setup
      run: npm install
    - name: Compile javascript
      run: npm run build
    - name: List files
      run: ls -al
    - name: Location
      run: pwd
    - name : FTP-Deploy
      uses: SamKirkland/FTP-Deploy-Action@master
      env: 
        FTP_SERVER :  ${{ secrets.FTP_SERVER }}
        FTP_PASSWORD :  ${{ secrets.FTP_PASSWORD }}
        FTP_USERNAME :  ${{ secrets.FTP_USERNAME }}
        LOCAL_DIR : ${{ secrets.LOCAL_DIR }}

LOCAL_DIR secret value is: /build

Deploy fails with "fatal: Remote host not set."

Thanks for continuing to update this! Unfortunately, I can't seem to get version 3 to work.

Here's the relevant part of my .yml, which I had updated according to the migration guide:

name: Publish Website
jobs:
  FTP-Deploy-Action:
    name: FTP-Deploy-Action
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@master
        with:
          fetch-depth: 2
      - name: FTP-Deploy-Action
        uses: SamKirkland/FTP-Deploy-Action@master
        with:
          ftp-server: ftp://example.com/
          ftp-username: ${{ secrets.FTP_USERNAME }}
          ftp-password: ${{ secrets.FTP_PASSWORD }}

And here's how that fails to work:
grafik

I've tried specifying the hostname with and without a trailing slash, and I've tried both ftp and sftp. There's obviously something I'm blatantly missing, I'm just not sure what.

Help would be appreciated!

Multiple Folders and FTPs

First of all, thanks to all that contribute to this, it is really helpful, thanks once again.

1 I want to ask what if I want to deploy to multiple folders on the same servers specifying the different folders, how do I go about it,

2 What if I want to deploy to multiple servers with different servers, each with their own server config.

Thanks

Secret ftp-password name is invalid

Bug Description
Cannot upload using SFTP because the yaml script requires a Secret named 'ftp-password' and Github will not let me add a Secret named 'ftp-password' as it is an invalid name.

My Action Config

on: push
name: Publish Website over SFTP
jobs:
  FTP-Deploy-Action:
    name: FTP-Deploy-Action
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
      with:
        fetch-depth: 2

    - name: FTP-Deploy-Action
      uses: SamKirkland/[email protected]
      with:
        ftp-server: sftp://webpages.uncc.edu:22/
        ftp-username: mwells21
        ftp-password: ${{ secrets.SFTP_PASSWORD }}

My Action Log

(node:1) UnhandledPromiseRejectionWarning: Error: Input required and not supplied: ftp-password

image

FTP-Deploy-Action delete ignored files

Hello,

I explain the situation:

I'm a French WordPress Developper. I made website with pulgin I download and also plugin I develop my self.

In my project root I ignore folders and files from downloaded plugin through a .gitignore as I only git my own development.

Problem is with the --delete args, file not in Github and present on the host will be deleted...

Solution
Your action should check if a .gitignore exists and if so do not delete directory listed in it.

This is my idea, maybe you have a workflow to suggest to me?

FTPS with --verbose stuck at Uploading files

I can't seem to get it to work successfully. The FTP that I'm using seems to only work over FTPS, so I'm wondering if that's the issue. But it just spins at Uploading files... and doesn't seem to give me any connection errors or the like.

Wondering if I'm missing something.

Here is my current config.

on: push
name: Publish Website
jobs:
  FTP-Deploy-Action:
    name: FTP-Deploy-Action
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - name: FTP-Deploy-Action
      uses: SamKirkland/[email protected]
      env:
        FTP_SERVER: ${{ secrets.FTP_SERVER }}
        FTP_USERNAME: ${{ secrets.FTP_USERNAME }}
        FTP_PASSWORD: ${{ secrets.FTP_PASSWORD }}
        ARGS: --delete --verbose

How to use --key

How to use --key to connect to a SSH server without using password ? It seems that we have to provide a SSH key file name, does that means to upload the SSH key on the repo ? Is it possible to save SSH key on Secrets ?

Troubleshooting

Hi @SamKirkland,
for some reason action's not appearing in "Visual Editor" at all, after pasting it through "Edit File" step. Did it happen to you before?

Multiple git branch and differenct FTP folder

Hello SamKirkland

Thanks once again for your response, it was helpful.
But I have another issue related to issue no #37, which is, I want to do multiple deployment based on git branch

  • uses: actions/checkout@master TO FTP::production
    AND
  • uses: actions/checkout@development TO FTP::development

Thanks

Translate error code

After installation and setup I get:

The process 'git' failed with exit code 8

Next try:

The process 'git' failed with exit code 5

All cryptic and irrelevant

This isn't in standard "git" error code. It come from library:
https://github.com/git-ftp/git-ftp/blob/master/man/git-ftp.1.md#exit-codes

Even that, code wasn't proper one.
My host have firewall (block IP) and this stop first random action (so download or upload)

Propose rewrite number code in failed message to actually message from library (as a Hint in second line). Maybe link to place where exit codes is? Add info to check details where is really more info?

As this repo is about action, message can help diagnose where look for error and don't create another issues there but in proper place.

Screen looks like that, yes - I can check details, but first think what looks is that error isn't from my side:
Zrzut ekranu 2020-03-15 o 14 26 06

Syntax error

Hi. So I'm getting a syntax error with this script, on the line FTP_SERVER:...

name: Deployment
on: [push]
jobs:
FTP-Deploy-Action:
name: FTP-Deploy-Action
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Deploy to website through ftp
uses: SamKirkland/[email protected]
env:
FTP_SERVER: ${{ secrets.FTP_SERVER }}
FTP_USERNAME: ${{ secrets.FTP_USERNAME }}
FTP_PASSWORD: ${{ secrets.FTP_PASSWORD }}

I've tried surrounding the secret declarations with quotes like "${{ secrets... }}"

local-dir default is not the same as specifying ./ explicitly

Bug Description
When not setting local-dir, the default should be ./
https://github.com/SamKirkland/FTP-Deploy-Action/blob/master/src/main.ts#L27

However, I get different results from:

  • Not specifying the local-dir arg
  • Specifying it as ./

When not specifying it, it will only upload main.yml to the server, so my suspicion is that the local dir is set to the .github/workflows folder, rather than the root of the repository.

My Action Config

on:
  push:
    branches:
      - master
name: Publish Website
jobs:
  FTP-Deploy-Action:
    name: FTP-Deploy-Action
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
      with:
        fetch-depth: 2

    - name: FTP-Deploy-Action
      uses: SamKirkland/[email protected]
      with:
        ftp-server: <ip>
        ftp-username: joren
        ftp-password: ${{ secrets.FTP_PASSWORD }}
        git-ftp-args: --insecure --remote-root home/joren

My Action Log

  Sun Mar 29 22:13:47 UTC 2020: Having files to sync.
  Sun Mar 29 22:13:47 UTC 2020: 1 file to sync:
  Sun Mar 29 22:13:47 UTC 2020: [1 of 1] Buffered for upload '.github/workflows/main.yml'.
  Sun Mar 29 22:13:47 UTC 2020: Uploading ...
  #=#=#                                                                         
  ##O#- #                                                                       
  ##O=#  #                                                                      
  #=#=-#  #                                                                     
  -#O#- #   #                                                                   
  -=#=#   #   #                                                                 
  -=O#- #  #    #                                                               
  -=O=#  #   #   #                                                              
  -=O=-#  #    #   #                                                            
  -=O=- #   #   #     #                                                         
  
  ######################################################################## 100.0%
  Sun Mar 29 22:13:50 UTC 2020: Uploading commit log to sftp://joren:***@<ip>/home/joren/.git-ftp.log.
  #=#=#                                                                         
  ##O#- #                                                                       
  ##O=#  #                                                                      
  #=#=-#  #                                                                     
  -#O#- #   #                                                                   
  -=#=#   #   #                                                                 
  -=O#- #  #    #                                                               
  -=O=#  #   #   #                                                              
  -=O=-#  #    #   #                                                            
  Sun Mar 29 22:13:52 UTC 2020: Last deployment changed from 016dd33d406fb2cbe1b424190f989635f1f82925 to 1a208e77f30e594cbf2e86c5b670f73b7d33bb63.
✅ Deploy Complete

Setting local-dir explicitly to ./ works for me, uploads everything as I expected.

Clear the folder before/after upload

I think this was possible in the past when you passed on the --delete arg? But this no longer seems to work and i can't find it back in the docs.

But when you build something with vue/react or any other js library as far as i know they give some files unique hashed names everytime. That means on every upload i'm having extra files i no longer need.

Is it possible to clear the folder before or preferably after? The later will need to see what files are new or changed and remove the rest i suppose. Where before will cause a small downtime.

ARGS: parameter not set - make ARGS optional

Hi there,
recent version adds support for ARGS parameter, but if someone isn't using it then the deploy won't work.
I get this error:

Starting FTP Deploy
Uploading files...
/entrypoint.sh: line 12: ARGS: parameter not set

I use Your action like so:

    - name: FTP Deploy
      uses: SamKirkland/FTP-Deploy-Action@master
      env: 
       FTP_SERVER: ${{ secrets.FTP_SERVER }}
       FTP_PASSWORD: ${{ secrets.FTP_PASSWORD }}
       FTP_USERNAME: ${{ secrets.FTP_USERNAME }}
       REMOTE_DIR: ${{ secrets.REMOTE_DIR }}
       LOCAL_DIR: ${{ secrets.LOCAL_DIR }}

Can ARGS be optional?

Issues with --exclude and --include

I'm trying to use the --exclude and --include ARGS to exclude everything except a few files and everything in one certain directory. I'm not sure that's possible, but hopefully it is. I've been trying:

--exclude '.*' --exclude '.*/' --include 'public_html/github-actions-test/.gitattributes' --include 'public_html/github-actions-test/.gitignore' --include 'public_html/github-actions-test/wp-content/themes/github-actions-test*' --include 'public_html/github-actions-test/wp-content/themes/github-actions-test*/' --exclude-glob=.git*/** --exclude-glob=.git** --dry-run

The above doesn't work, and I'm just wondering if this is possible.

Failed on RM

Hello

I still have some trouble with the script

rm: Access failed: Failure (generated)```
is a way exists to know why it failed ?

kex_exchange_identification: read: Operation timed out

Hello,
I tryed many times and I have a problem on deployment

Set up job
4s
Build SamKirkland/[email protected]
19s
Run actions/checkout@master
2s
FTP-Deploy-Action
2h 13m 1s
Wed, 20 Nov 2019 22:59:39 GMT ##[error]Docker run failed with exit code 255
Wed, 20 Nov 2019 20:46:38 GMT
Run SamKirkland/[email protected]
Wed, 20 Nov 2019 20:46:38 GMT /usr/bin/docker run --name e4e3a8d5236f028094b15af655279be20741d_66d008 --label 2e4e3a --workdir /github/workspace --rm -e FTP_SERVER -e FTP_USERNAME -e FTP_PASSWORD -e METHOD -e PORT -e ARGS -e LOCAL_DIR -e REMOTE_DIR -e INPUT_FTP_SERVER -e INPUT_FTP_USERNAME -e INPUT_FTP_PASSWORD -e INPUT_METHOD -e INPUT_PORT -e INPUT_LOCAL_DIR -e INPUT_REMOTE_DIR -e INPUT_ARGS -e HOME -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e GITHUB_ACTIONS=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/thivinfo.com/thivinfo.com":"/github/workspace" 2e4e3a:8d5236f028094b15af655279be20741d  "" "" "" "ftp" "21" "" ""
Wed, 20 Nov 2019 20:46:38 GMT Starting FTP Deploy
Wed, 20 Nov 2019 20:46:39 GMT Establishing SFTP connection...
Wed, 20 Nov 2019 20:46:39 GMT kex_exchange_identification: read: Operation timed out
Wed, 20 Nov 2019 22:59:39 GMT Connection closed
Wed, 20 Nov 2019 22:59:39 GMT ##[error]Docker run failed with exit code 255
Post actions/checkout@master
1s
Complete job```
I don't know if I made a mistake on Actions settings or if this is a host firewall problem..

deploying two repos to the same server but into different subdirectories fails

Bug Description
I have two repos that I'm trying to deploy on push to the same FTP server but into specific sub directories for each on said server.

I was able to successfully lint, build, and then deploy the first repo - a Vue.js app into its subdirectory let's call it subdir-1.

However for the second repo, also a Vue.js app but living on the server in subdir-2, after it successfully lints and builds the deployment fails with the following error:

fatal: Dirty repository: Having uncommitted changes. Exiting...

The only difference in the yaml files is the subdirectory for where the uploaded files should be put. So I'm stumped as to what's causing it.

For my copy & pastes below I removed any potentially sensitive info.

My Action Config for successful deployment

name: Staging

on: [push]

jobs:

  lint-then-deploy:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [12.x]

    steps:
    - uses: actions/checkout@master
      with:
        fetch-depth: 2

    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v1
      with:
        node-version: ${{ matrix.node-version }}

    - name: Add SSH deploy key for installing private repos
      run: |
        mkdir ~/.ssh/
        # Add keys
        echo "${{ secrets.GITHUB_READONLY_DEPLOY_KEY }}" > ~/.ssh/id_rsa
        echo "${{ secrets.GITHUB_READONLY_DEPLOY_KEY_PUB }}" > ~/.ssh/id_rsa.pub
        # Verifiy keys
        ssh-keygen -l -f ~/.ssh/id_rsa.pub
        # Add github.com to known hosts
        ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
        # Set correct permissions
        chmod 600 ~/.ssh/id_rsa

    - name: Installing node deps
      run: npm install

    - name: Linting
      run: npm run lint

    - name: Build project
      run: npm run build

    - name: List output files
      run: ls

    - name: FTP deploy action
      uses: SamKirkland/[email protected]
      with:
        ftp-server: sftp://subdomain.example.com:1234/
        ftp-username: ${{ secrets.FTP_USERNAME }}
        ftp-password: ${{ secrets.FTP_PASSWORD }}
        local-dir: ./dist
        git-ftp-args: --insecure --remote-root level-a/subdir-1

My Action Config for unsuccessful deployment

name: Staging

on: [push]

jobs:

  lint-then-deploy:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [12.x]

    steps:
    - uses: actions/checkout@master
      with:
        fetch-depth: 2

    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v1
      with:
        node-version: ${{ matrix.node-version }}

    - name: Add SSH deploy key for installing private repos
      run: |
        mkdir ~/.ssh/
        # Add keys
        echo "${{ secrets.GITHUB_READONLY_DEPLOY_KEY }}" > ~/.ssh/id_rsa
        echo "${{ secrets.GITHUB_READONLY_DEPLOY_KEY_PUB }}" > ~/.ssh/id_rsa.pub
        # Verifiy keys
        ssh-keygen -l -f ~/.ssh/id_rsa.pub
        # Add github.com to known hosts
        ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
        # Set correct permissions
        chmod 600 ~/.ssh/id_rsa

    - name: Installing node deps
      run: npm install

    - name: Linting
      run: npm run lint

    - name: Build project
      run: npm run build

    - name: List output files
      run: ls

    - name: FTP deploy action
      uses: SamKirkland/[email protected]
      with:
        ftp-server: sftp://subdomain.example.com:1234/
        ftp-username: ${{ secrets.FTP_USERNAME }}
        ftp-password: ${{ secrets.FTP_PASSWORD }}
        local-dir: ./dist
        git-ftp-args: --insecure --remote-root level-a/subdir-2

My Action Log
WORKING LOGS

2020-03-10T05:50:25.6057985Z ##[group]Run SamKirkland/[email protected]
2020-03-10T05:50:25.6058351Z with:
2020-03-10T05:50:25.6058659Z   ftp-server: sftp://subdomain.example.com:1234/
2020-03-10T05:50:25.6058979Z   ftp-username: ***
2020-03-10T05:50:25.6059673Z   ftp-password: ***
2020-03-10T05:50:25.6059998Z   local-dir: ./dist
2020-03-10T05:50:25.6060333Z   git-ftp-args: --insecure --remote-root level-a/subdir-1
2020-03-10T05:50:25.6060696Z ##[endgroup]
2020-03-10T05:50:25.6097713Z ##[command]/usr/bin/docker run --name e87b529fc256941dca437e99d6dc0163455428_0b3b56 --label e87b52 --workdir /github/workspace --rm -e INPUT_FTP-SERVER -e INPUT_FTP-USERNAME -e INPUT_FTP-PASSWORD -e INPUT_LOCAL-DIR -e INPUT_GIT-FTP-ARGS -e HOME -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/webgui-launchpad-overlay/webgui-launchpad-overlay":"/github/workspace" e87b52:9fc256941dca437e99d6dc0163455428
2020-03-10T05:50:26.7860049Z ##[group]Uploading files
2020-03-10T05:50:26.7885812Z [command]git ftp push --force --auto-init --verbose --syncroot ./dist --user *** --passwd *** --insecure --remote-root level-a/subdir-1 sftp://subdomain.example.com:1234/
2020-03-10T05:50:26.8061341Z Tue Mar 10 05:50:26 UTC 2020: git-ftp version 1.5.1 running on Linux 735a39ef57fc 5.0.0-1032-azure #34-Ubuntu SMP Mon Feb 10 19:37:25 UTC 2020 x86_64 GNU/Linux
2020-03-10T05:50:26.8061872Z Tue Mar 10 05:50:26 UTC 2020: Forced mode enabled.
2020-03-10T05:50:26.8062311Z Tue Mar 10 05:50:26 UTC 2020: Auto init if needed.
2020-03-10T05:50:26.8084193Z Tue Mar 10 05:50:26 UTC 2020: Using syncroot ./dist if exists.
2020-03-10T05:50:26.8134414Z Tue Mar 10 05:50:26 UTC 2020: Insecure SSL/TLS connection allowed
2020-03-10T05:50:26.8548514Z Tue Mar 10 05:50:26 UTC 2020: Host is 'subdomain.example.com:1234'.
2020-03-10T05:50:26.8562136Z Tue Mar 10 05:50:26 UTC 2020: User is '***'.
2020-03-10T05:50:26.8599615Z Tue Mar 10 05:50:26 UTC 2020: Password is set.
2020-03-10T05:50:26.8650477Z Tue Mar 10 05:50:26 UTC 2020: CACert is ''.
2020-03-10T05:50:26.8681409Z Tue Mar 10 05:50:26 UTC 2020: Insecure is '1'.
2020-03-10T05:50:26.8728838Z Tue Mar 10 05:50:26 UTC 2020: Proxy is ''.
2020-03-10T05:50:26.8856680Z Tue Mar 10 05:50:26 UTC 2020: Path is 'level-a/subdir-1/'.
2020-03-10T05:50:26.8889505Z Tue Mar 10 05:50:26 UTC 2020: Syncroot is './dist/'.
2020-03-10T05:50:26.8941907Z Tue Mar 10 05:50:26 UTC 2020: The remote sha1 is saved in file '.git-ftp.log'.
2020-03-10T05:50:26.8954488Z Tue Mar 10 05:50:26 UTC 2020: Check if curl is functional.
2020-03-10T05:50:26.9044531Z Tue Mar 10 05:50:26 UTC 2020: Retrieving last commit from sftp://***:***@subdomain.example.com:1234/level-a/subdir-1/.
2020-03-10T05:50:27.1133945Z #=#=#                                                                         
2020-03-10T05:50:27.2177202Z ##O#- #                                                                       
2020-03-10T05:50:27.3810069Z ##O=#  #                                                                      
2020-03-10T05:50:27.5415177Z #=#=-#  #                                                                     
2020-03-10T05:50:27.6970204Z -#O#- #   #                                                                   
2020-03-10T05:50:28.3371364Z -=#=#   #   #                                                                 
2020-03-10T05:50:28.4526874Z -=O#- #  #    #                                                               
2020-03-10T05:50:28.6022601Z -=O=#  #   #   #                                                              
2020-03-10T05:50:28.7516726Z -=O=-#  #    #   #                                                            
2020-03-10T05:50:28.9014222Z -=O=- #   #   #     #                                                         
2020-03-10T05:50:28.9014498Z 
2020-03-10T05:50:28.9769881Z ######################################################################## 100.0%
2020-03-10T05:50:29.0644004Z Tue Mar 10 05:50:29 UTC 2020: No changed files, but different commit ID. Changed files ignored or commit amended.
2020-03-10T05:50:29.0691226Z Tue Mar 10 05:50:29 UTC 2020: Including all files in dist/ for upload.
2020-03-10T05:50:29.0838554Z Tue Mar 10 05:50:29 UTC 2020: Having files to sync.
2020-03-10T05:50:29.0916189Z Tue Mar 10 05:50:29 UTC 2020: 8 files to sync:
2020-03-10T05:50:29.0955348Z Tue Mar 10 05:50:29 UTC 2020: [1 of 8] Buffered for upload 'dist/assets/svg/sprite.svg'.
2020-03-10T05:50:29.0989880Z Tue Mar 10 05:50:29 UTC 2020: [2 of 8] Buffered for upload 'dist/css/app.ee59fe68.css'.
2020-03-10T05:50:29.1027636Z Tue Mar 10 05:50:29 UTC 2020: [3 of 8] Buffered for upload 'dist/css/chunk-vendors.8c1841d4.css'.
2020-03-10T05:50:29.1057419Z Tue Mar 10 05:50:29 UTC 2020: [4 of 8] Buffered for upload 'dist/index.html'.
2020-03-10T05:50:29.1089747Z Tue Mar 10 05:50:29 UTC 2020: [5 of 8] Buffered for upload 'dist/js/app.f7a9fe4c.js'.
2020-03-10T05:50:29.1121165Z Tue Mar 10 05:50:29 UTC 2020: [6 of 8] Buffered for upload 'dist/js/app.f7a9fe4c.js.map'.
2020-03-10T05:50:29.1152752Z Tue Mar 10 05:50:29 UTC 2020: [7 of 8] Buffered for upload 'dist/js/chunk-vendors.c1f95af0.js'.
2020-03-10T05:50:29.1180253Z Tue Mar 10 05:50:29 UTC 2020: [8 of 8] Buffered for upload 'dist/js/chunk-vendors.c1f95af0.js.map'.
2020-03-10T05:50:29.1211444Z Tue Mar 10 05:50:29 UTC 2020: Uploading ...
2020-03-10T05:50:29.3893198Z #=#=#                                                                         
2020-03-10T05:50:29.5511068Z ##O#- #                                                                       
2020-03-10T05:50:29.7137839Z ##O=#  #                                                                      
2020-03-10T05:50:29.8703120Z #=#=-#  #                                                                     
2020-03-10T05:50:30.6209061Z -#O#- #   #                                                                   
2020-03-10T05:50:30.7367818Z -=#=#   #   #                                                                 
2020-03-10T05:50:30.8869447Z -=O#- #  #    #                                                               
2020-03-10T05:50:31.1884429Z -=O=#  #   #   #                                                              
2020-03-10T05:50:31.1885202Z 
2020-03-10T05:50:31.3382842Z ####################                                                      28.2%
2020-03-10T05:50:31.3383333Z ############################################                              61.6%
2020-03-10T05:50:31.4135856Z ######################################################################## 100.0%
2020-03-10T05:50:31.5636532Z 
2020-03-10T05:50:31.6392673Z ######################################################################## 100.0%
2020-03-10T05:50:31.7893029Z 
2020-03-10T05:50:31.8646020Z ######################################################################## 100.0%
2020-03-10T05:50:32.0151966Z 
2020-03-10T05:50:32.0899994Z ######################################################################## 100.0%
2020-03-10T05:50:32.2411953Z 
2020-03-10T05:50:32.2412487Z #######################################################################   99.4%
2020-03-10T05:50:32.3163792Z ######################################################################## 100.0%
2020-03-10T05:50:32.4669606Z 
2020-03-10T05:50:32.6172124Z #################                                                         24.4%
2020-03-10T05:50:32.6921086Z #######################################################                   77.7%
2020-03-10T05:50:32.7669884Z ######################################################################## 100.0%
2020-03-10T05:50:32.9180280Z 
2020-03-10T05:50:33.0691318Z #############                                                             19.4%
2020-03-10T05:50:33.1440789Z ######################################################################## 100.0%
2020-03-10T05:50:33.2949860Z 
2020-03-10T05:50:33.4470497Z ##                                                                         3.9%
2020-03-10T05:50:33.5984048Z ###############                                                           21.0%
2020-03-10T05:50:33.7508293Z ###########################                                               38.1%
2020-03-10T05:50:33.9030407Z #######################################                                   55.2%
2020-03-10T05:50:34.0544702Z ####################################################                      72.3%
2020-03-10T05:50:34.1302766Z #############################################################             85.5%
2020-03-10T05:50:34.2080152Z ######################################################################## 100.0%
2020-03-10T05:50:34.2869353Z Tue Mar 10 05:50:34 UTC 2020: Uploading commit log to sftp://***:***@subdomain.example.com:1234/level-a/subdir-1/.git-ftp.log.
2020-03-10T05:50:34.4999366Z #=#=#                                                                         
2020-03-10T05:50:34.6158414Z ##O#- #                                                                       
2020-03-10T05:50:34.7793310Z ##O=#  #                                                                      
2020-03-10T05:50:34.9432962Z #=#=-#  #                                                                     
2020-03-10T05:50:35.1027329Z -#O#- #   #                                                                   
2020-03-10T05:50:35.9644633Z -=#=#   #   #                                                                 
2020-03-10T05:50:36.0819932Z -=O#- #  #    #                                                               
2020-03-10T05:50:36.2342990Z -=O=#  #   #   #                                                              
2020-03-10T05:50:36.3866839Z -=O=-#  #    #   #                                                            
2020-03-10T05:50:36.4855945Z -=O=- #   #   #     #                                                         
2020-03-10T05:50:36.5392257Z -=O=-   #   #   #     #                                                       
2020-03-10T05:50:36.6180539Z Tue Mar 10 05:50:36 UTC 2020: Last deployment changed from de0623e0eaaa0e708eacfb7a4f0ca314c7abba48 to c2d765d8f786f4953a45d32b567520b3653246de.
2020-03-10T05:50:36.6229037Z ##[endgroup]
2020-03-10T05:50:36.6241067Z ✅ Deploy Complete
2020-03-10T05:50:36.8037416Z Post job cleanup.
2020-03-10T05:50:36.8938076Z [command]/usr/bin/git version
2020-03-10T05:50:36.8989979Z git version 2.25.1
2020-03-10T05:50:36.9016033Z [command]/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
2020-03-10T05:50:36.9038908Z http.https://github.com/.extraheader
2020-03-10T05:50:36.9047856Z [command]/usr/bin/git config --local --unset-all http.https://github.com/.extraheader
2020-03-10T05:50:36.9082778Z [command]/usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader && git config --local --unset-all http.https://github.com/.extraheader || :
2020-03-10T05:50:36.9340849Z Cleaning up orphan processes

NOT WORKING LOGS

2020-03-10T05:50:46.2904381Z ##[group]Run SamKirkland/[email protected]
2020-03-10T05:50:46.2904702Z with:
2020-03-10T05:50:46.2904986Z   ftp-server: sftp://sftp://subdomain.example.com:1234/
2020-03-10T05:50:46.2905592Z   ftp-username: ***
2020-03-10T05:50:46.2905888Z   ftp-password: ***
2020-03-10T05:50:46.2906160Z   local-dir: ./dist
2020-03-10T05:50:46.2906476Z   git-ftp-args: --all --insecure --dry-run --remote-root level-a/subdir-2
2020-03-10T05:50:46.2906830Z ##[endgroup]
2020-03-10T05:50:46.2929632Z ##[command]/usr/bin/docker run --name e87b5278912d056b8149aeb8e50c5bacce26e2_e4a670 --label e87b52 --workdir /github/workspace --rm -e INPUT_FTP-SERVER -e INPUT_FTP-USERNAME -e INPUT_FTP-PASSWORD -e INPUT_LOCAL-DIR -e INPUT_GIT-FTP-ARGS -e HOME -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/registration-wizard/registration-wizard":"/github/workspace" e87b52:78912d056b8149aeb8e50c5bacce26e2
2020-03-10T05:50:47.8842722Z ##[group]Uploading files
2020-03-10T05:50:47.8865839Z [command]git ftp push --force --auto-init --verbose --syncroot ./dist --user *** --passwd *** --all --insecure --dry-run --remote-root level-a/subdir-2 sftp://sftp://subdomain.example.com:1234/
2020-03-10T05:50:47.9038733Z Tue Mar 10 05:50:47 UTC 2020: git-ftp version 1.5.1 running on Linux 1b85a25d9201 5.0.0-1032-azure #34-Ubuntu SMP Mon Feb 10 19:37:25 UTC 2020 x86_64 GNU/Linux
2020-03-10T05:50:47.9039528Z Tue Mar 10 05:50:47 UTC 2020: Forced mode enabled.
2020-03-10T05:50:47.9040082Z Tue Mar 10 05:50:47 UTC 2020: Auto init if needed.
2020-03-10T05:50:47.9063163Z Tue Mar 10 05:50:47 UTC 2020: Using syncroot ./dist if exists.
2020-03-10T05:50:47.9106246Z Tue Mar 10 05:50:47 UTC 2020: Insecure SSL/TLS connection allowed
2020-03-10T05:50:47.9120347Z Tue Mar 10 05:50:47 UTC 2020: Running dry, won't do anything.
2020-03-10T05:50:47.9475847Z Tue Mar 10 05:50:47 UTC 2020: fatal: Dirty repository: Having uncommitted changes. Exiting...
2020-03-10T05:50:47.9508748Z ##[endgroup]
2020-03-10T05:50:47.9517069Z ⚠� Failed to upload files
2020-03-10T05:50:47.9522857Z ##[error]The process 'git' failed with exit code 8
2020-03-10T05:50:47.9529464Z ⚠� Error deploying
2020-03-10T05:50:47.9532241Z ##[error]The process 'git' failed with exit code 8
2020-03-10T05:50:48.1488675Z Post job cleanup.
2020-03-10T05:50:48.2521458Z [command]/usr/bin/git version
2020-03-10T05:50:48.2579014Z git version 2.25.1
2020-03-10T05:50:48.2617829Z [command]/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
2020-03-10T05:50:48.2649497Z http.https://github.com/.extraheader
2020-03-10T05:50:48.2658827Z [command]/usr/bin/git config --local --unset-all http.https://github.com/.extraheader
2020-03-10T05:50:48.2692389Z [command]/usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader && git config --local --unset-all http.https://github.com/.extraheader || :
2020-03-10T05:50:48.2974623Z Cleaning up orphan processes

Edit:
I've googled for solutions and didn't find a whole lot. Here's some potentially helpful links that I came across. But I'm not sure if they're fully relevant.

create build before deploy

Hi!
How can I run a build script together with this?
Like 'npm run build' and then deploy the /dist folder

Deploy a .Net core build

Hello, I love this action by the way it's very useful.

I am having some issues trying to use this with one of my .net core 3.1 builds. I am unsure on how to upload just the build of the .net core.

Heres a few outputs I am getting:

When going to the FTP deploy section:

/usr/bin/docker run --name e87b5248c6555427d54fedbd5ac9c14af2afed_17fc5a --label e87b52 --workdir /github/workspace --rm -e DOTNET_ROOT -e INPUT_FTP-SERVER -e INPUT_FTP-USERNAME -e INPUT_FTP-PASSWORD -e INPUT_LOCAL-DIR -e INPUT_GIT-FTP-ARGS -e HOME -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e GITHUB_ACTIONS=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/Los-Santos-V/Los-Santos-V":"/github/workspace" e87b52:48c6555427d54fedbd5ac9c14af2afed
Uploading files
  git ftp push --force --auto-init --verbose --syncroot Server/bin/Release/netcoreapp3.1 --user *** --passwd *** ftp://193.70.80.232
  Fri Feb 21 15:57:41 UTC 2020: git-ftp version 1.5.1 running on Linux 0e84ace6b059 5.0.0-1031-azure #33-Ubuntu SMP Thu Feb 6 22:26:13 UTC 2020 x86_64 GNU/Linux
  Fri Feb 21 15:57:41 UTC 2020: Forced mode enabled.
  Fri Feb 21 15:57:41 UTC 2020: Auto init if needed.
  Fri Feb 21 15:57:41 UTC 2020: Using syncroot Server/bin/Release/netcoreapp3.1 if exists.
  Fri Feb 21 15:57:41 UTC 2020: Host is '193.70.80.232'.
  Fri Feb 21 15:57:41 UTC 2020: User is '***'.
  Fri Feb 21 15:57:41 UTC 2020: Password is set.
  Fri Feb 21 15:57:41 UTC 2020: CACert is ''.
  Fri Feb 21 15:57:41 UTC 2020: Insecure is '0'.
  Fri Feb 21 15:57:41 UTC 2020: Proxy is ''.
  Fri Feb 21 15:57:41 UTC 2020: Path is ''.
  Fri Feb 21 15:57:41 UTC 2020: fatal: 'Server/bin/Release/netcoreapp3.1' is not a directory! Exiting...
⚠️ Failed to upload files
⚠️ Error deploying
##[error]The process 'git' failed with exit code 8
##[error]The process 'git' failed with exit code 8```




When I build with .net, it outputs my .dll here:

`Server -> /home/runner/work/Los-Santos-V/Los-Santos-V/Server/bin/Release/netcoreapp3.1/Server.dll`

My ftp local dir is set:

`local-dir: Server/bin/Release/netcoreapp3.1`

I have also set this to the full path above and also `local-dir: build`

open: ***: Name does not resolve

Hi,

Apologies if there's a better place to put this issue. I've just tried to implement this into a project and every build is failing. I have my three secrets set up (FTP_SERVER, FTP_USERNAME and FTP_PASSWORD) but when I look into the Actions tab it fails.

image

FTP Deploy Action:

Run SamKirkland/FTP-Deploy-Action@master

          

            env:

          

              FTP_PASSWORD: ***

          

              FTP_SERVER: ***

          

              FTP_USERNAME: ***

          
/usr/bin/docker run --name df7dc5a975570098d4c0ebb70c109605185a5_c21419 --label 0df7dc --workdir /github/workspace --rm -e FTP_PASSWORD -e FTP_SERVER -e FTP_USERNAME -e HOME -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/██████/██████":"/github/workspace" 0df7dc:5a975570098d4c0ebb70c109605185a5
Starting FTP Deploy
Uploading files...
open: ***: Name does not resolve

Googling isn't helping me figure out what this "name does not resolve" thing means, hoping you could help?

FTP_SERVER ARGS not defined error is coming

Hello!

I am trying to configure this git action in my repository. Here is my main.yml file looks like.

name: Publish Website
on: 
  push:
    branches:
    - master
jobs:
  deploy:
    name: FTP-Deploy-Action
    runs-on: ubuntu-latest
    steps:
      - name: FTP-Deploy-Action
        uses: SamKirkland/[email protected]
        with:
          FTP_SERVER: thcitsolutions.com
          ftp_username: [email protected]
          ftp_password: ##ActualPasswordGoesHere##
          method: ftp
          port: 21
          # The local folder to copy, defaults to root project folder
          # local_dir: # optional, default is 
          # The remote folder to copy to, deafults to root FTP folder (I recommend you configure this on your server side instead of here)
          remote_dir: test # optional, default is 
          # Passes through options into lftp
          ARGS: --exclude=.ftpquota --exclude-glob=.git*/** --exclude-glob=.git**

But when I push to master branch, it is giving error while connecting to FTP (/entrypoint.sh: line 25: FTP_SERVER: parameter not set). PFA screenshot for reference purpose.

Can you please guide what I am missing.
GitHub FTP - Error Screenshot

Note: I am new to Git Action and this is my first git action.

Login failed: 550 SSL/TLS required on the control channel

Hello,
When using sftp the action do not make error but no files are transferred :-(
I try by ftp and got the error "Login failed: 550 SSL/TLS required on the control channel" any idea on what's wrong ?

Many thanks for your job

Dirty repository when uploading build product

Bug Description
I'm experiencing the error fatal: Dirty repository: Having uncommitted changes. Exiting... when trying to upload my build product to an FTP server. The build is an Angular build using webpack.

The upload worked once and now I cannot make it work again. Not even with the exact same commit.

My Action Config

name: Deploy app

on:
    push:
        branches:
            - master

jobs:
    build-and-deploy:
        runs-on: ubuntu-latest

        steps:
            - uses: actions/checkout@master
              with:
                  fetch-depth: 2

            - name: Set up Node.js version
              uses: actions/setup-node@v1
              with:
                  node-version: '12.x'

            - name: npm install, build, and test
              run: |
                  npm install
                  npm run build --prod

            - name: 'Deploy to website'
              uses: SamKirkland/[email protected]
              with:
                  ftp-server: ${{ secrets.FTP_SERVER }}
                  ftp-username: ${{ secrets.FTP_USER }}
                  ftp-password: ${{ secrets.FTP_PASSWORD }}
                  local-dir: dist/

My Action Log

   git ftp push --force --auto-init --verbose --syncroot dist/ --user [REMOVED] --passwd *** ftp://[REMOVED]/public_html
  Thu Mar 19 08:10:52 UTC 2020: git-ftp version 1.5.1 running on Linux 3c5c2018866a 5.0.0-1032-azure #34-Ubuntu SMP Mon Feb 10 19:37:25 UTC 2020 x86_64 GNU/Linux
  Thu Mar 19 08:10:52 UTC 2020: Forced mode enabled.
  Thu Mar 19 08:10:52 UTC 2020: Auto init if needed.
  Thu Mar 19 08:10:52 UTC 2020: Using syncroot dist/ if exists.
  Thu Mar 19 08:10:52 UTC 2020: fatal: Dirty repository: Having uncommitted changes. Exiting...

Failed to download action

Bug Description
Fails to download v3 action
My Action Config

name: .NET Core

on: [push]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v1
    - name: Setup .NET Core
      uses: actions/setup-dotnet@v1
      with:
        dotnet-version: 3.1.100
    - name: Build with dotnet
      run: dotnet build DataEntry/DataEntry.sln --configuration Release
    - name: Publish
      run: dotnet publish DataEntry/DataEntry.MVC/DataEntry.MVC.csproj --configuration Release --output PublishResult
    - name: FTP-Deploy-Action
      uses: SamKirkland/[email protected]
      with:
        ftp-server: ftp://ftp.........
        ftp-username: ftpusernameinhere.....
        ftp-password: ${{ secrets.FTP_PASSWORD }}
        local-dir: PublishResult
        git-ftp-args: --lock --remote-root=data-entry\src

My Action Log

Failed to download action 'https://api.github.com/repos/SamKirkland/FTP-Deploy-Action/tarball/3.0.0'. Error Response status code does not indicate success: 404 (Not Found).

SSH Private Key

Hello,
Is a way exists to specify a private key io a password ?

Many thanks for your job

Action is very slow as compared to other

Hi,
I don't if it makes sense to ask this,

I tested SamKirkland/FTP-Deploy-Action and found that its very slow. I just tested it with upload a single file to server. It takes more than 2 minutes to complete the action.

Then I tested https://github.com/sebastianpopp/ftp-action , and that worked fast comparatively.

Attached is the screenshot of SamKirkland/FTP-Deploy-Action with the title "Publish Website over SFTP"

and sebastianpopp/ftp-action with the title "Deploy via ftp"

I am still curious and feel that SamKirkland action may the one to go with,
but I can't wait 2 minutes each time.
Before using these actions I used to commit and push my changes to github and then use the another FTP software like FileZilla to upload my files to the server,
Now I want it to be a single step, when I push changes to github, they should be automatically uploaded to server too.

But am I using it the right way? because most of the times there are less than 10 files mostly 2 to 3 files to upload to server.

Sorry if I haven't explained the issue clearly.

gitActions

FTP modified only?

Does this ftp only the changed or modified files or everything each time it runs?

Refactor proposal: FAQ

We need FAQ (https://github.com/SamKirkland/FTP-Deploy-Action#faq) to be refactor and detailed.

Propose:

  1. First point need to adress information that connection is between GitHub Action <-> Remote server
Check:
- open details in arrow where more information is available
- is IP from USA/EU enable to access HOST?
- is credentials proper?
- use "git-ftp-args: --insecure" as there can be misconfiguration on remote server with secure connection
- check firewall, iptables, hostname resolution, cache (24h wait)
  1. Point second need additional info:
Any file outside of repository, generated in other step won't be uploaded.
Use check .git-ftp-include what is included in push and .git-ftp-ignore what are ommit.
  1. Third point
    There need more information about permission. This file is alphabetically first on list and because that is error on one file. Many files on host must be disabled from sync.

  2. Four point need add example

  3. Any point need to be linkable as header (https://help.github.com/en/github/writing-on-github/basic-writing-and-formatting-syntax#section-links) and format correctly - more precise answer in issue reply.

  4. Maybe add --test flag for uploading example file (permission, connection and stuff before git command run). Required to run before new issue created.

  5. Maybe use detail syntax in points https://github.github.com/gfm/#html-blocks ?

Description for point
  1. Link to other resource as GIT, GIT PUSH, FTP protocol, maybe somewhere is instruction about all connection case issue?

I will help with content but asking what direction is going this github action. No roadmap, no wiki, no guildlines and there exist double issue on same topic. Maybe add to Readme about what type of contribution and what thinks that GitHub Action must do and don't ? No need to bloat simple think, just have production grade solution on some weird ftp host.

--delete also remove files not in Github

For the purpose of this issue here is my folder structure on Github :

-/upload
-/upload/file.jpg
-/index.html

On my FTP the structure is :

-/upload
-/upload/file.jpg
-/upload/my_client_personal_folder/
-/upload/my_client_personal_folder/file.txt
-/index.html

With the --delete argument: if I change index.html, the index file is uploaded and /upload/my_client_personal_folder/ and his content is deleted.

But if I don't have --delete and I decide to remove /upload/file.jpg, it will not be removed from the FTP.

Is there a way to delete only the files in Github ? So user generated content in the FTP would not be effected, but still retain the ability to remove files.

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.