balena-io / deploy-to-balena-action

Official Github action to deploy releases to balenaCloud environments
Apache License 2.0
38 stars 13 forks source link

Error: Unsure how to proceed with event: workflow_dispatch #89

Closed mikhail-vl closed 2 years ago

mikhail-vl commented 2 years ago

I was looking to run GitHub Action on-demand using workflow_dispatch event type, which is not supported.

Error: Unsure how to proceed with event: workflow_dispatch

Any plans to support it in the near future?

20k-ultra commented 2 years ago

Interesting, I hadn't considered this workflow. From what I just learned, you select a branch to run the action on..this would be similar to the master workflow in that you don't get a draft release which is then finalized on merge.

I don't see any issue with making this action work with this! Could you elaborate on why you want to manually trigger the action just so I understand the use case more.

mikhail-vl commented 2 years ago

@20k-ultra, thank you for your response. Workflow_dispatch is useful during the Development stage and testing.

We manually built multiple GitHub Packages from different repositories and then we push to Balena on-demand using workflow_dispatch. I would like to avoid custom action with balena-cli and use this action instead if you can add it.

Please let me know if you have any questions.

20k-ultra commented 2 years ago

hey @mikhailredis, if the action builds a final release when workflow_dispatch event is used will that suffice for you ? I can totally do this but we want to make sure the solution isn't patching another problem.

Wouldn't you want to build only when there is a change in your source code ? If you have several repositories that are developed and used in a single repository, wouldn't that repository you're running the dispatch have a commit that bumps the dependency versions ? This seems to be the correct way of handling dependencies. Therefore, the workflows we have should work.

I am open to modifying the action for people's needs but I'm trying to see if the additional complexity is worth it as it will require additional documentation to explain this new way to deploy and might lead people to using the action in a way we don't want to encourage.

I think the PR workflow to provide significant benefits so I want to encourage people use that. Let me know what I'm missing and we'll work this out!

mikhail-vl commented 2 years ago

@20k-ultra Thank you for your response. While waiting we created an action based on the balena cli which already supports this functionality and provides additional benefits like balena secrets out of the box: https://github.com/Theia-Scientific/balena-cli

Regarding multiple repositories, our Balena deployment is based on the 4-5 packages hosted on GHCR created using GitHub Actions after merging to the specific repository. To test changes in updated packages we do manual dispatch with the finalizing to the test fleet. After the end of the sprint, we bump the main repository which triggers Balena Push to the Production fleet.

See if this PR adds benefits to the project and will help others, otherwise, you may close it. We will stick to our own solution for now.

20k-ultra commented 2 years ago

Hey Mikhail, I understand your need for that workflow and it makes sense to me. See https://github.com/balena-io/deploy-to-balena-action/issues/153#issuecomment-1175802100 for our decision regarding adding new workflows. I hope you understand and we can work on new workflows if they match the goals mentioned in that comment.

mikhail-vl commented 2 years ago

@20k-ultra Thank you for your attention. We are happy with our custom Action wrapping balena-cli and it works great!