My requirement is to pre-render pages from CMS and store in S3. In my app i have .env.development, .env.prod variables which holds the API endpoints of CMS.
I have two separate Jenkins job, one is for dev and another is for prod build. So when I start Jenkins job to build as "npm run build:dev" or "npm run build:prod" then it fetches JSON from CMS api endpoints defined in .env.development or .env.prod and creates build with version as "myapp-dev-<x.o>" or "myapp-prod-<x.o>" and upload in to nexus and also to S3.
But now the ask is to have a single build for both dev and prod and create only one version "myapp-<x.o>" My question is how is it possible to have pre-rendered pages based on environments within the same build version?