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

Allow absolute paths for the build_dir option #159

Closed
yrd opened this issue Dec 6, 2021 · 0 comments · Fixed by #161
Closed

Allow absolute paths for the build_dir option #159

yrd opened this issue Dec 6, 2021 · 0 comments · Fixed by #161

Comments

@yrd
Copy link
Contributor

yrd commented Dec 6, 2021

Could you please add an option to make this path.join optional?

await copy(path.join(currentdir, buildDir), tmpdir, {

The reason is that I would like to deploy a folder built with Nix. When Nix builds something, the output lands in a central store under /nix/store and the output which gets placed in the current directory is a symlink to the store location. Since the build_dir option needs a relative path, I end up having to work around this problem by prepending it with ../../../../../, which is kind of ugly. It works for now, but I would prefer to be able to provide an absolute path (or even better, just be able to provide the symlink, but that doesn't seem to work because the copy function doesn't want to overwrite a folder with a symlink).

Thanks!

yrd added a commit to iWeltAG/zucker that referenced this issue Dec 6, 2021
When deploying the built documentation files using the action by
crazy-max, it would complain[1] that it doesn't want to copy the
'result' symlink we get from running 'nix build' to the folder where
the deployed stuff is. That's why we need to export the actual store
location into an output and use that as the build directory. Further,
the action expects a relative path[2], so we need to traverse the
filesystem back up all the way so we can get to the nix store.

1: https://github.com/iWeltAG/zucker/runs/4427892335
2: crazy-max/ghaction-github-pages#159
yrd added a commit to yrd/ghaction-github-pages that referenced this issue Jan 13, 2022
This commit adds absolute_build_dir as an additional input. If the
option is set, the provided build_dir argument won't be treated as a
relative path to the current working directory anymore. This is helpful
in environments like Nix, where the build is output to a static folder
(for example /nix/store).

Closes crazy-max#159.
@crazy-max crazy-max linked a pull request Jan 13, 2022 that will close this issue
crazy-max added a commit that referenced this issue Jan 13, 2022
* Add absolute_build_dir input option

This commit adds absolute_build_dir as an additional input. If the
option is set, the provided build_dir argument won't be treated as a
relative path to the current working directory anymore. This is helpful
in environments like Nix, where the build is output to a static folder
(for example /nix/store).

Closes #159.

* Add follow_symlinks option

This option allows symbolic links in the source directory to be
followed, recursively copying the entire directory structure.

* Update outputs

* Add missing inputs to action.yml

* Add default values to input options

This concerns absolute_build_dir and follow_symlinks.

Co-authored-by: CrazyMax <github@crazymax.dev>

Co-authored-by: CrazyMax <github@crazymax.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants