ai-blog icon indicating copy to clipboard operation
ai-blog copied to clipboard

Only trigger deploy to Netlify from main branch

Open jspiewak opened this issue 2 years ago • 4 comments

The Netlify step appears to run on every change, regardless of branch, resulting in no-op deployments in Netlify. Should it have if: github.ref == 'refs/heads/main' as a guard clause like the GitHub deploy?

https://github.com/rstudio/ai-blog/blob/main/.github/workflows/main.yml#L93

jspiewak avatar Apr 22 '22 14:04 jspiewak

Hi Josh,

no, it shouldn't result in no-op deployments ... for every preview triggered, I got notified about deployment locations that look like this:

https://6262b882578849340255bc1c--hardcore-kirch-782335.netlify.app/

For us, it is important to be able to preview posts after individual changes have been made, so we can see if something breaks the layout, a picture renders nicely, etc.

Of course, the posts are written offline at first, but before deployment, some changes will have to be made (for example, due to review comments).

skeydan avatar Apr 22 '22 14:04 skeydan

harcore-kirch isn't an rstudio Netlify site. What I am referring to is the triggering of a Netlify build of reverent-jones-333de8, which is the meta-blog site. Those are no ops because it only builds main.

jspiewak avatar Apr 22 '22 15:04 jspiewak

Should hardcore-kirch be transferred to the rstudio Netlify team?

jspiewak avatar Apr 22 '22 15:04 jspiewak

That sounds great, thank you very much! Honestly I don't even have access - Netlify was managed by Javier before he left ... If the RStudio team could take care of it that'd be awesome ...

skeydan avatar Apr 22 '22 15:04 skeydan