New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

netlify should only deploy when repo is tagged #3206

Closed
boneskull opened this Issue Jan 17, 2018 · 8 comments

Comments

Projects
None yet
3 participants
@boneskull
Copy link
Member

boneskull commented Jan 17, 2018

@Munter when we merge changes into master which have documentation updates, those updates go live, even if the features they describe aren't yet in Mocha.

I'd like to have it deploy when:

  • a new Git tag or release happens
  • manually

(ideally both)

Is that doable?

@Munter

This comment has been minimized.

Copy link
Member

Munter commented Jan 17, 2018

Manual deploy is certainly possible. That sounds quite impractical though. I don't see anything in the admin interface that would allow only deploying on a release.

These re the options available:
image

I guess we could have a docs branch and merge master into it whenever we want to deploy the documentation.

I can ask netlify if there is a way to trigger deploys on releases. Their rest API doesn't seem to have a hook to trigger a deploy for a commit/tag

@boneskull

This comment has been minimized.

Copy link
Member

boneskull commented Jan 17, 2018

yeah I guess we can automate a branch push upon release

@boneskull

This comment has been minimized.

Copy link
Member

boneskull commented Jan 17, 2018

For now let's just use a docs branch. Let's add a postpublish script which resets the branch to the latest tag.

If there isn't a module on npm to do this, let's publish one.

@samuelcolvin

This comment has been minimized.

Copy link

samuelcolvin commented Apr 30, 2018

Just found this issue while trying to find out whether netlify have built-in support for release only on tags.

Apparently, they don't which I think is mad.

But my workaround for pydantic is to setup netlify to deploy a fictional branch foobar (to avoid netlify auto-deploying), then manually deploy from CI when a tag is created, see here for the makefile command, and here for the travis setup.

I think that's more elegant than manually pushing to a branch.

@boneskull

This comment has been minimized.

Copy link
Member

boneskull commented Apr 30, 2018

@samuelcolvin thanks for the tip!

@pksunkara pksunkara referenced this issue Sep 6, 2018

Closed

Move storybook.js.org to Netlify #4126

2 of 2 tasks complete

@ndelangen ndelangen referenced this issue Oct 23, 2018

Open

Storybook docs deployment #4207

0 of 2 tasks complete

@rdebeasi rdebeasi referenced this issue Nov 26, 2018

Closed

Status blog #258

@Munter

This comment has been minimized.

Copy link
Member

Munter commented Dec 11, 2018

The lodash.com has a setup where the docs are availabel for the latest version of each major version release. This is using jekyll and netlify for hosting. Maybe there is inspiration to be found here:

https://github.com/lodash/lodash.com/blob/master/_config.yml#L6-L9
https://github.com/lodash/lodash.com/blob/master/_redirects#L4-L12

@boneskull

This comment has been minimized.

Copy link
Member

boneskull commented Dec 13, 2018

cc @Munter @craigtaub

I tried this:

  1. I rolled back to the earliest good deploy of v5.2.0 (deploys were failing around the release, but this was fixed sometime after). That's eeccd05 if we want to be specific.
  2. I disabled auto-publishing of the production branch (master)
  3. I didn't change our deployment preview settings.
  4. I created an incoming webhook on netlify. These only trigger a build against a selected branch. I selected master.
  5. I created an outgoing webhook on GitHub to be triggered whenever a GitHub "release" event occurs.

This doesn't work, unfortunately, because of the disabled auto-publishing.

Netlify's API has an endpoint to lock/unlock auto-publishing, however. I'll see what I can do with this. If I can't figure it out, we'll just have to create a branch for doc publishing, and update that branch every time we tag a release (or automate it).

@boneskull

This comment has been minimized.

Copy link
Member

boneskull commented Dec 13, 2018

OK, yeah, in order to make that happen properly I'd need to either create a GitHub app or action. The former is more work than I'm willing to do atm (though using Probot would be a great place to start), and the later is still in private beta, so whatever. Branches it is for now.

I'll configure netlify to only publish, say, the mochajs.org branch, and keep that updated when we release.

@boneskull boneskull closed this Dec 13, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment