File tree Expand file tree Collapse file tree 8 files changed +22
-14
lines changed
Expand file tree Collapse file tree 8 files changed +22
-14
lines changed Original file line number Diff line number Diff line change 11API_URL =
2- APP_URL =
2+ NEXT_PUBLIC_APP_URL =
33
44FIREBASE_API_KEY =
55FIREBASE_AUTH_DOMAIN =
Original file line number Diff line number Diff line change @@ -29,15 +29,15 @@ jobs:
2929 aws-secret-access-key : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
3030 aws-region : ${{ secrets.AWS_REGION }}
3131
32- - name : export secret key
33- run : |
34- echo "${{ vars.production_ENV }}" > .env
32+ # - name: export secret key
33+ # run: |
34+ # echo "${{ vars.production_ENV }}" > .env
3535
3636 - name : Login to Amazon ECR
3737 id : login-ecr
3838 uses : aws-actions/amazon-ecr-login@v1
3939 with :
40- mask-password : ' true'
40+ mask-password : " true"
4141
4242 # This is a separate action that sets up buildx runner
4343 - name : Setup Docker Buildx
5858 ECR_REGISTRY : ${{ steps.login-ecr.outputs.registry }}
5959 ECR_REPOSITORY : ${{ secrets.REPOSITORY }}
6060 IMAGE_TAG : ${{ vars.IMAGE_TAG }}
61+ NEXT_PUBLIC_APP_URL : ${{ vars.NEXT_PUBLIC_APP_URL }}
6162 run : |
62- docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
63+ docker build \
64+ --build-arg NEXT_PUBLIC_APP_URL=$NEXT_PUBLIC_APP_URL \
65+ -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
6366 docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
6467
6568 deploy-frontend-service :
Original file line number Diff line number Diff line change @@ -19,6 +19,10 @@ FROM node:24-alpine AS builder
1919WORKDIR /app
2020COPY . .
2121
22+ # Accept build arguments for NEXT_PUBLIC environment variables
23+ ARG NEXT_PUBLIC_APP_URL
24+ ENV NEXT_PUBLIC_APP_URL=$NEXT_PUBLIC_APP_URL
25+
2226RUN yarn
2327
2428RUN yarn build
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ export const viewport: Viewport = {
2525export const metadata : Metadata = {
2626 title : SITE_NAME ,
2727 description : SITE_DESCRIPTION ,
28- metadataBase : new URL ( process . env . APP_URL ! ) ,
28+ metadataBase : new URL ( process . env . NEXT_PUBLIC_APP_URL ! ) ,
2929 keywords : [
3030 'library management' ,
3131 'book tracking' ,
Original file line number Diff line number Diff line change @@ -14,6 +14,6 @@ export default function robots(): MetadataRoute.Robots {
1414 '/users/*' ,
1515 ] ,
1616 } ,
17- sitemap : `${ process . env . APP_URL } /sitemap.xml` ,
17+ sitemap : `${ process . env . NEXT_PUBLIC_APP_URL } /sitemap.xml` ,
1818 }
1919}
Original file line number Diff line number Diff line change @@ -50,9 +50,8 @@ export async function loginAction(
5050 cookieStore . set ( sessionName , token , {
5151 maxAge,
5252 httpOnly : true ,
53- domain : `.${ process . env . APP_URL ?. slice ( process . env . APP_URL . indexOf ( '://' ) + 3 ) } ` ,
54- secure : process . env . NODE_ENV === 'production' ,
55- sameSite : 'lax' ,
53+ secure : true ,
54+ sameSite : 'strict' ,
5655 } )
5756
5857 // set active library
Original file line number Diff line number Diff line change 1- // utilized next.config.js rewrites
2- // cookies are available in client requests
3- export const BASE_URL = `${ process . env . APP_URL } /api/v1`
1+ export const BASE_URL =
2+ typeof window === 'undefined'
3+ ? `${ process . env . API_URL } /api/v1`
4+ : `${ process . env . NEXT_PUBLIC_APP_URL } /api/v1`
Original file line number Diff line number Diff line change 44 "private" : true ,
55 "scripts" : {
66 "dev" : " next dev --turbopack" ,
7+ "devs" : " next dev --turbopack --experimental-https" ,
78 "build" : " next build --turbopack" ,
89 "start" : " next start" ,
910 "lint" : " eslint ." ,
You can’t perform that action at this time.
0 commit comments