Multiple builds on the same repo using different configuration files

Hello netlify support,

I am building a Javascript npm package and I host the source on github.
I have setup 2 CD pipelines on the repo:

  • the first one behaves as a CDN to deliver the transpiled dist of my lib for easy usage in the browser.
  • the second one handles the documentation so it stays up to date with each branch without having to manually rebuild it.

To allow my first build to behave as a proper CDN, I want to set the headers age using the configuration file. However, I want to apply different headers to my CDN (stable code) and my doc build (can change quite often).

How would you suggest doing this?
An alternative for me, that I already implemented in another repo, is to have the documentation hosted on github and have it build through an action. However, I wanted to go for a different route this time and have proper CD on my doc (github pages can only host one version at a time).$

Thank you so much for the great work !

Cheers

Hi @terazus,

I think you can specify the path for the stable file and assign headers specifically to it. Then, for the rest of the website, you could simply not specify any headers (considering you wish to use Netlify’s default headers).

1 Like