As I promised in my last post, I have written this text to show how Azure, GitHub, and NextJS can play nicely together. I wanted to use Github actions to deploy my application to Azure, but I stumbled on a number of issues on my journey. So I hope the following summary of my experience will be helpful to everyone who wants to walk the same path.

Actually, finding a way to deploy my app felt like a detective’s investigation. I needed to search for bits of information in various different GitHub issues and blogs.

So, let’s start with an essential question:

What is the release artifact?

In theory, the NextJS built application consists of the whole content of the “.next” folder after you run the command “next build.” In practice, it is not the case. The folder contains the “cache” folder, which seems like a temporary cache for the NextJS compiler. The folder can grow really big because every build increases the folder size and should definitely be omitted from your deployed artifacts.

What really amuses me is the fact that the documentation doesn’t mention it at all. I had to go to great lengths to find it in GitHub Issues.

As one of the senior software developers of Vercel  commented:

You need to cache .next/cache across builds, but it doesn’t need to be uploaded into the release artifact. There’s no docs that cover this atm.

#github-actions #nextjs #github

Deployment Of NextJS Application using GitHub Action to Azure
2.30 GEEK