How to Set up Netlify Deploys for Docfx using GitHub Actions

Sean Killeen - Feb 27 - - Dev Community

We currently use docfx to publish the NUnit docs, because it has a lovely capability of generating docs for our API reference in addition to all our articles.

However, one thing I often yearn for – that I get on this Jekyll blog and some others I work with – is the ability to have a live preview within a pull request of what the generated site will look like.

Because the source code for the API docs is in the nunit repository, and the docs live in the docs repo, it’ll be a little extra complicated.

Nevertheless: Let’s make it happen.

The Conceptual Approach

  • We pull the NUnit DLL and create the docfx site
  • We zip up the site
  • We create a custom GitHub environment to be associated with our deployment environment
  • We manually update the statuses of that deployment
  • We deploy to Netlify
  • We post the link as a comment in the PR

The Build Steps

Read more at SeanKilleen.com!

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .