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.

New Option destination_dir for deploying to a subdirectory

See original GitHub issue

Is your feature request related to a problem? Please describe

Some users seem to want to deploy to a subdirectory.

Describe the solution you’d like

Add a new option destination_dir for setting a directory name.

Describe alternatives you’ve considered

We can use the option keep_files in this case already. But it seems to be a little difficult for users to understand the behavior.

- name: Setup assets
  run: |
    mkdir public subdir1
    mv your_contents ./subdir1/
    mv ./subdir1 ./public/

- name: Deploy
  uses: peaceiris/actions-gh-pages@v3
  with:
    github_token: ${{ secrets.GITHUB_TOKEN }}
    publish_dir: ./public
    keep_files: true

After we get the destination_dir option, the above steps will be merged into one as follows.

- name: Deploy
  uses: peaceiris/actions-gh-pages@v3
  with:
    github_token: ${{ secrets.GITHUB_TOKEN }}
    publish_dir: ./public
    destination_dir: ./subdir1

Additional context

It seems tedious to implement and test it in consideration of a variety of situations.

To be investigated:

  • #507 Weird nesting of content folders

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:25 (16 by maintainers)

github_iconTop GitHub Comments

2reactions
peaceiriscommented, Feb 16, 2021

@m-mohr According to the following line, when the keep_files is false, only the destination_dir will be cleaned up.

https://github.com/peaceiris/actions-gh-pages/blob/d3a97d53a80c403efae6ac6f0016b0ce79e5543b/src/git-utils.ts#L109-L116

1reaction
peaceiriscommented, Feb 16, 2021

@m-mohr I understood your suggestion now. (Sorry, I deleted my previous comment before I get your new reply.)

Thank you for the suggestion. I am working on https://github.com/peaceiris/actions-gh-pages/pull/569/files, I am happy if you review it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

INF DestinationDirs section - Windows drivers - Microsoft Learn
A DestinationDirs section specifies the target destination directory or directories for all copy, delete, and/or rename operations on files ...
Read more >
Build Inputs - Builds | Developer Guide | OpenShift Dedicated 3
If your application exists inside a sub-directory, you can override the default location (the root folder) using this field.
Read more >
How to deploy a React app to a subdirectory | by Scott Vinkle
1. Set the basename. Setting the basename attribute on the <Router /> component tells React Router that the app will be served from ......
Read more >
install — CMake 3.25.1 Documentation
New in version 3.21. This option causes all runtime dependencies of installed executable, shared library, and module targets to be added to the...
Read more >
Working With Files - Gradle User Manual
You can include files in subdirectories by using an Ant-style glob pattern ( **/* ) ... They all share most of the configuration...
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