shalzz / zola-deploy-action

Github action for building a Zola site and deploying to Github Pages
MIT License
234 stars 91 forks source link

Add `WORKING_DIR` environmental variable. #60

Closed azriel91 closed 1 year ago

azriel91 commented 1 year ago

Heya, I have a workflow that clones the website repository into a subdirectory (it clones a number of repositories).

That workflow needs this action to switch to the sub directory before continuing.

shalzz commented 1 year ago

Hi, you should be able to do this at the action level. Either via the actions/checkout or via the working-directory option (https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_iddefaultsrun)

azriel91 commented 1 year ago

ah, I tried using working-directory first, but that configuration parameter only works when using run (shell action) instead of uses: <some action>.

Someone else also hit this (stack overflow comment), and it seems it has to be supported by the action

shalzz commented 1 year ago

We already have the BUILD_DIR option for that.

shalzz commented 1 year ago

Maybe you want to push up the cd $BUILD_DIR command so that the git repo is also in the same dir. I don't know though if it would have unintended side effects.

azriel91 commented 1 year ago

ah yes, it was the submodule update that failed in my github action.

There shouldn't be any other side effects, the previous commands are:

which are all not sensitive to working-directory.

Shall open another PR -- after confirming submodule updates work when run from a sub-directory.