question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to deploy from subdir into root?!?!

See original GitHub issue

Bug Description Pcheeew. This was my very first time setting up an action. I had the problem that my HUGO repository

  • built into a public sub-directory and
  • I wanted this to end up in the root (or a test folder).
  • But the action kept loading it into another public directory on the server!

Well… actually it is solved. It just took me ages to fiddle around with the slashes, quotation marks and arguments 😦

I now believe that it is the / at the end of the local-dir: path. But actually: I have no clue! It just works and I’m really scared to touch anything.

I was also playing around with the git-ftp-args: --remote-root until I saw @SamKirkland 's comment somewhere to just use the ftp-server: directly 👍

  • maybe this could have another example?
  • examples for what the ./ actually does?
  • use cases for git-ftp-args: --remote-root and examples?

My Action Config

on:
  push:
      ...
      - name: FTP Deploy
        uses: SamKirkland/FTP-Deploy-Action@3.1.1
        with:
          # Deployment destination server & path. Formatted as protocol://domain.com:port/full/destination/path/
          ftp-server: ${{ secrets.SERVER }}/domain.com/
          ftp-username: ${{ secrets.USER }}
          ftp-password: ${{ secrets.PW }}
          local-dir: public/

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:2
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
sampletext32commented, Nov 26, 2020

Hi, here is a little suggestion. I use the following piece of yml. Assume that your previous CI steps produced an artifact, named build

upload:
    name: FTP Deploy
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@master
      - name: Download Artifact 'build'
        uses: actions/download-artifact@master
        with:
          name: 'build'
          path: '${{ github.workspace }}/build'      
      - name: FTP Deploy
        uses: SamKirkland/FTP-Deploy-Action@3.1.1
        with:
          ftp-server: '${{ secrets.FTP_SERVER }}'
          ftp-username: '${{ secrets.FTP_USERNAME }}'
          ftp-password: '${{ secrets.FTP_PASSWORD }}'
          local-dir: 'build/'
          git-ftp-args: '--all'

Create .git-ftp-include file in the root of your repo with the following content

!build/

everything should work out of the box.

0reactions
SamKirklandcommented, Jan 30, 2022

@AleksandrovC please create a new issues and post your action settings. Also the best solution is to create a FTP account with the default path set to your destination root. Then no settings are needed. You should not be trying to navigate up several folder levels from your default path, most hosts prevent this because you could modify server files (…/…/…/…/…/…/serverConfigFile)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Set subdirectory as website root on Github Pages
Deploying a subfolder to GitHub Pages. Sometimes you want to have a subdirectory on the master branch be the root directory of a...
Read more >
Moving WordPress from Sub-Directory to Root Directory
To do this with FTP, in the remote server area, toggle open the subdirectory containing the WordPress installation you wish to move.
Read more >
How to Move WordPress From a Subfolder to Root Directory
Open the .​​ To show hidden files on FileZilla, navigate to Server on the top menu bar and select Force showing hidden files....
Read more >
Deploy to subdirectory of /ROOT - PROD environment
I would like deployment as /ROOT/MyProject/MyApp(s) but am concerned that folder and file referencing in the Development Environment (and code ...
Read more >
Deploying subdirectory projects to Heroku - JTWay
The repository has some specific build or meta configuration in the repository root. The resulting project for deployment gets built into a repository ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found