Given a workflow that is triggered on = "deployment" I would like to both deploy and update the deployment-api. From what I gather I guess these are my alternatives:
1. Deploy action does a http call to deployments api on failure/success
2. Deploy action saves deploy result in a file and uses exit code 0 for success. The sequential action reads from that file and does a http call to deployments api.
3. Use checks api or a Github App to notify Deployments API on failure/success
1 I don't like because it is hard to reuse code. 2 reuses code, but complicates deploy actions. 3 would be great, but how?
Anyone doing something similar? All the examples I find, that does deployment, never updates the deployment api. Most of them just does deploy automatically if the branch is the master branch.
Solved! Solved! Go to Solution.
Thank you for taking the time to write your feedback! Hopefully, someone else here has a similar workflow and can share their experience. In the meanwhile, I've taken your feedback and passed it along to the appropriate teams.
Mark helpful posts with Accept as Solution to help other users locate important info. Don't forget to give Kudos for great content!
I found a functional solution for this, going along with option number 1.
What I found to be working quite well, was to create a generic action that adds shell scripts which later actions can reuse. The scripts strive to be as minimal as possible, and has only one dependency, and that is curl.
It worked pretty well for a couple of projects that we are testing on, and the code is made available at https://github.com/unacast/actions/tree/master/github-deploy
I'd much appreciate comments or even better - pull requests :)
#1 Yes please :)
#2 That was my initial thought also. But that's was not how it is implemented to begin with. Maybe later down the line. I think it could be pretty clean. Although it might be difficult for the App that is subscribing to the events from the workflow to extract information that it would like to add to a deployment status event
I also wonder how we can send a request like that in for consideration?
I don't quite know, seems like this is the place. Admins replies to discussions I see, and informs that they are taking the matter to the development team.
Thanks for the suggestion! While we don't have an official place to submit feature requests, @judoole is correct that GitHub Staff does frequent the GitHub Community Forum and as admins and moderators, we do our best to capture this sort of feedback and share it with the teams who are in charge of designing and improving GitHub.
Speaking of which, I've passed your feedback on to the appropriate teams. I can't promise if we will implement this suggestion or when we can make that happen, but we're always looking for new solutions and if we do implement this feature, it will be announced in the GitHub changelog.
Hey @judoole 👋🏽
This looks like a nice and simple solution until GitHub adds a tighter integration with their own Deployment API. Imho, as @jerrylopez pointed out, if an action is triggered by a `deployment` event, it would have be great if GitHub provided an option to update the deployment in question - automatically populating it with target url and description.
In the meanwhile, I've looked at your solution and got it working with SlashDeploy - a chatbot to manage deployments from Slack. I've created an aws-eb custom action, which uses your scripts and now I am finally getting deployment notifications into our Slack 🙌🏽.
There is some room for improvement, so expect from me a PR that would populate log url and deployment description soon 😉.
I've had a quick look at Slashdeploy recently, love the work you are doing! We are considering it to replace Hubot for deployments from Slack. Think I tried to register a couple of weeks ago, but I think it failed, probably because I'm don't have owner-rights of the Unacast organization or something. Love that you can specify configuration within the repository.
For now, I've tested using the Github Slack integration for notifications. It is trying to add a deploy action in near future, it seems like. But I think it won't be as feature friendly as Slashdeploy :)
Thx, @judoole It's still in PoC as I can't get the log URL and description of the deployment. Also, noticed you've bumped into a similar issue and tested that it's not being exposed in `ENV`. I think we have to wait for that to come in from GitHub.
Regarding SlashDeploy registration failure - you should be able to request GitHub app installation from organization/repository admins. Mind dropping me an email to `tair [at] getslashdeploy [com]` so I could help you out? It'd be really awesome if Unacast benefited from all those features we've built to support team deployment workflow 😉
Btw, did you find a solution to the create a log_url to the action @assimovt? I also asked that in https://github.community/t5/GitHub-API-Development-and/Github-Actions-url-to-run/m-p/16471#M506