GithubHelp home page GithubHelp logo

Comments (4)

Burnett01 avatar Burnett01 commented on May 18, 2024

I have images folder on my website which stores user's uploaded images so that I want to keep this folder between deploys to not be deleted with sync.
Is there a way to achieve that??

Hello, sure thing! Simply use the --exclude switch or the --filter switch.

Here is an example (assuming your image folder is located at /var/www/images):

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: rsync deployments
      uses: burnett01/[email protected]
      with:
        switches: -avzr --delete --exclude="images"
        path: src/
        remote_path: /var/www/html/
        remote_host: ${{ secrets.DEPLOY_HOST }}
        remote_port: ${{ secrets.DEPLOY_PORT }}
        remote_user: ${{ secrets.DEPLOY_USER }}
        remote_key: ${{ secrets.DEPLOY_KEY }}

If your images folder is located at a deeper level and not at remote_path, simply adjust the path to your folder in the --exclude switch:

--exclude="public/images"

Greetings, Steve

from rsync-deployments.

kosratdev avatar kosratdev commented on May 18, 2024

I have some default images on it so I have to include it and while developing maybe we will add some other default images too so that I want to merge the images folder but I don't want to merge other folders right now I'm using the following SWITCHES
-rltgoDzvO
It will merge all other folders but I want only to merge the images folder, not others.
is there any solution for my situation?

from rsync-deployments.

Burnett01 avatar Burnett01 commented on May 18, 2024

I have some default images on it so I have to include it and while developing maybe we will add some other default images too so that I want to merge the images folder but I don't want to merge other folders right now I'm using the following SWITCHES
-rltgoDzvO
It will merge all other folders but I want only to merge the images folder, not others.
is there any solution for my situation?

Yes you could use the --include switch to only have the images folder deployed by rsync.
Example: --include="*/images" --exclude="*"

If you wish to keep certain images (default images) but not all of them, you could combine --include and --exclude as shown above, or use a filter.

Example with --include/exclude:
--include="/images/" --include="/images/default.png" --exclude="*"

Example with --filter:
Create a filter.conf file in your .github folder (in your repo) with the following content:

+ /images/
+ /images/default.png
- *

Now you can use that filter with the --filter switch:
--filter="merge .github/filter.conf"

from rsync-deployments.

Burnett01 avatar Burnett01 commented on May 18, 2024

If you need further help, feel free to re-open this issue.

from rsync-deployments.

Related Issues (20)

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.