From c869f32ed4f536760e3034f1003a258d5c1336cf Mon Sep 17 00:00:00 2001 From: ahmadgaz Date: Mon, 7 Oct 2024 13:39:00 -0700 Subject: [PATCH] github action fix build --- .github/workflows/pr.yml | 26 ++++++-------------------- app/layout.tsx | 2 +- 2 files changed, 7 insertions(+), 21 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 6b78d80..bb33432 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -20,23 +20,13 @@ jobs: run: | npm run lint - typecheck: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup node and install dependencies - uses: ./.github/actions/setup-node-and-install - with: - node-version: 20 - - - name: Typecheck test - run: | - npm run type-check - build: + environment: Production runs-on: ubuntu-latest + env: + NODE_ENV: production + NEXT_PUBLIC_BASE_URL: ${{ secrets.NEXT_PUBLIC_BASE_URL }} + BASE_API_URL: ${{ secrets.BASE_API_URL }} steps: - name: Checkout code uses: actions/checkout@v4 @@ -47,11 +37,7 @@ jobs: node-version: 20 - name: Build app - run: | - touch .env.local - echo NEXT_PUBLIC_BASE_URL=${{ secrets.NEXT_PUBLIC_BASE_URL }} >> .env.local - echo BASE_API_URL=${{ secrets.BASE_API_URL }} >> .env.local - npm run build + run: npm run build - name: Upload build artifact uses: actions/upload-artifact@v4 diff --git a/app/layout.tsx b/app/layout.tsx index d134643..3ce0ba3 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -5,7 +5,7 @@ import { Footer } from '@/components/organisms'; import { cookies } from 'next/headers'; const inter = Inter({ subsets: ['latin'] }); - +console.log(process.env.NEXT_PUBLIC_BASE_URL); export const metadata: Metadata = { title: { template: '%s | Course Scheduler',