jsmrcaga/action-netlify-deploy

Why Docker? And why build the Project?

CEbbinghaus opened this issue · 2 comments

I have been integrating this action into my workflow since uploading via the API is a lot more limiting.

my two questions outlined in the title are:

  1. Why run all of this in a docker container? the entire build process is already containerized so it just adds more overhead to the processing slowing down the action itself and causing unnecessary logs.

  2. Why does it automatically try and build the project. In my workflow, I build to check that it compiles and then I cache the output directory. So when I run this action in a later job to deploy I have to manually set the install and build command to "" so it doesn't overwrite anything on accident.

It feels like this task is doing more than it's supposed to. Personally, I would assume that a Deploy task Deploys and doesn't also install the dependencies and then build the project too.

Hi @CEbbinghaus !

Thanks a lot for your questions, as for the answers:

1/ I wanted an action to deploy my netlify site on: release and at the time did not want to handle process & whatever so I went with Bash. Then I wanted to see how to create a Docker action so I decided to put the bash as entrypoint to learn how to build actions that way. There's no special benefit whatsoever and no performance reason.

2/ Sure ^^. Most projects will be hugo/gatsby/CRA so build will be necessary.

From your questions I would advice you to copy/paste the bash file into your .github folder and just use it with run if you don't need the build-step and don't like the Docker runtime for this action.

I hope I managed to answer your questions. I will be closing the issue but don't hesitate to comment again or re-open if you have more concerns

Thank you so much for your answers. I always encourage others to learn new things so I'm glad you are using docker here to learn it. I'm now using https://github.com/nwtgck/actions-netlify because it offers more customizability and doesn't have the build step or docker.

I was going to do that or just write a script to do it but in the end, someone else had already done it so I could leverage that.

Thank you so much for the answers though.