Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proposal: Being able to exclude a directory from being overriden #718

Open
3 tasks done
nnacin opened this issue Mar 10, 2022 · 6 comments
Open
3 tasks done

proposal: Being able to exclude a directory from being overriden #718

nnacin opened this issue Mar 10, 2022 · 6 comments
Assignees
Labels

Comments

@nnacin
Copy link

nnacin commented Mar 10, 2022

Checklist

  • I am using the latest version of this action.
  • I have read the latest README and followed the instructions.
  • I have read the latest GitHub Actions official documentation and learned the basic spec and concepts.

Describe your proposal

If you specify the name of the directory, when executing the GHA, keep that directory intact.

Describe the solution you'd like

I would like to be able to keep contents of a directory even after pushing files to the root.

Describe alternatives you've considered

No response

Additional context

No response

@peaceiris
Copy link
Owner

I do not know the details of your demand. But the option keep_files seems worth reading.

@nnacin
Copy link
Author

nnacin commented Mar 11, 2022

This wouldnt replace existing file, which I would still need.
Let me try to explain in more details. The destination dir is root so on every run of the GHA, everything is the root would be removed. I do want all the single files to be removed and recreated (even if some of them are named the same, maybe its content is different). But if there is an option like exclude_dir: name_of_directory it would keep this directory intact.

@tgreen7
Copy link

tgreen7 commented Aug 5, 2022

This would also be very useful when using pr-previews https://github.com/rossjrw/pr-preview-action

Every time a new build is deployed it wipes the pr-preview directory so all active previews are killed.

This issue and #771 are very similar.

@jorgecarleitao
Copy link

A related use-case is when static content refer to specific versions of published software. Say we have content for v1, v2 and main/latest.

It would be really cool to be able to have the action publish on tag push to docs/{tag}/index.html, and merge to main to docs/latest/index.html

This requires "overwriting" latest, but not any other content. In other words, a whitelist or regex expression declaring what to delete (keep_files is essentially a special case of this where true <> "*"

@tgreen7
Copy link

tgreen7 commented Aug 20, 2022

I switched to JamesIves/github-pages-deploy-action@v4. It has the following options

force: false
clean: true
clean-exclude: pr-preview/

which works perfectly for my use case.

@jorgecarleitao
Copy link

jorgecarleitao commented Aug 20, 2022

I just realized that destination_dir and keep_files: false is enough for versioning since we can just have one dir per version and have a "latest" or "main" for the latest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants