Next.js Discord

Discord Forum

Deploying NextJS with SSR to both Fargate and S3+CloudFront - using Github actions and Docker

Unanswered
Peterbald posted this in #help-forum
Open in Discord
PeterbaldOP
I'm currently deploying NextJS with SSR to Fargate using a Github workflow and Docker. It works as expected, and the next step is to add a CDN.
Should I sync /public and /.next/static with an S3 bucket in the github workflow? If so, should I build the nextjs app once in the github workflow and then deploy different parts of the same build to both fargate and S3? If not, how do you go about it?

Are there any best practices or github actions that already do this out of the box?

I prefer to not use IAC like SST for this.

I'm using NextJS v15.3.2.

0 Replies