zpnk / stage-ci

Automatic deploy previews for your PRs using zeit.co/now.
https://stage.now.sh
MIT License
131 stars 23 forks source link

Automatically alias commits on master #10

Open mxstbr opened 7 years ago

mxstbr commented 7 years ago

Let's say I have a pizza-app and deploy using stage-ci. Now I want all commits on master to automatically be deployed to production, i.e. be aliased to pizza-app.com.

Does that work?

amccloud commented 7 years ago

Not currently but it should be simple to do:

https://github.com/zpnk/stage-ci/blob/master/src/core.js#L71

The hardest part is deciding how to expose that functionality.

mxstbr commented 7 years ago

Environment variable on deploy of the webhook maybe? MASTER_ALIAS=pizza-app.com

That would be epic, it would essentially make stage-ci the most awesome deployment tool ever.

zpnk commented 7 years ago

I can see how this would be a really useful feature, and I like the idea a lot.

It's definitely do-able, but beyond configuration it would require adapting our implementation to respond to GitHub's PushEvent.

Quick background on how stage works currently:

If we add support for the push event my questions would be:

In terms of configuration, environment variables are the way to go. I'd propose two:

I'd also propose we just allow all events and let the server filter based on what we need (PullRequest, Push).

Not sure about deployment status.

If I have time to work on this I will assign myself and remove the "help wanted" label. Otherwise, if someone else wants to grab this, just post here.

mxstbr commented 7 years ago

Yep that sounds absolutely brilliant!

glambert commented 7 years ago

Would this also allow to have a static website always on the same URL for the latest master?