Skip to content

Commit

Permalink
upd env
Browse files Browse the repository at this point in the history
  • Loading branch information
JiangShuuu committed Nov 16, 2023
1 parent ec98a6d commit fb8bb12
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ GITHUB_ID=
GITHUB_SECRET=
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=

BASE_URL=
NEXTAUTH_URL=
13 changes: 13 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,25 @@ jobs:
echo GOOGLE_CLIENT_ID=${{ secrets.GOOGLE_CLIENT_ID }} >> .env
echo GOOGLE_CLIENT_SECRET=${{ secrets.GOOGLE_CLIENT_SECRET }} >> .env
echo NEXTAUTH_SECRET=${{ secrets.NEXTAUTH_SECRET }} >> .env
echo BASE_URL=${{ secrets.BASE_URL }} >> .env
echo NEXTAUTH_URL=${{ secrets.NEXTAUTH_URL }} >> .env
- name: Use Node.js Install & Run build # Node
uses: actions/setup-node@v3
with:
node-version: 20

# - name: cd file and install
# run: |
# npm install
# npm run build
# - name: Install dependencies and build
# uses: pnpm/action-setup@v2
# with:
# version: 8
# run: |
# pnpm install
# pnpm run build
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

Expand Down
10 changes: 5 additions & 5 deletions docker/dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ WORKDIR /app
# Install dependencies based on the preferred package manager
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./
RUN \
if [ -f yarn.lock ]; then yarn --frozen-lockfile; \
elif [ -f package-lock.json ]; then npm ci; \
elif [ -f pnpm-lock.yaml ]; then yarn global add pnpm && pnpm i --frozen-lockfile; \
else echo "Lockfile not found." && exit 1; \
fi
if [ -f yarn.lock ]; then yarn --frozen-lockfile; \
elif [ -f package-lock.json ]; then npm ci; \
elif [ -f pnpm-lock.yaml ]; then yarn global add pnpm && pnpm i --frozen-lockfile; \
else echo "Lockfile not found." && exit 1; \
fi


# Rebuild the source code only when needed
Expand Down
5 changes: 3 additions & 2 deletions src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ export function cn(...inputs: ClassValue[]) {

export function absoluteUrl(path: string) {
if (typeof window !== 'undefined') return path
if (process.env.VERCEL_URL) return `https://${process.env.VERCEL_URL}${path}`
// if (process.env.VERCEL_URL) return `https://${process.env.VERCEL_URL}${path}`
if (process.env.BASE_URL) return `https://${process.env.BASE_URL}${path}`
return `http://localhost:${process.env.PORT ?? 3000}${path}`
}

export function constructMetadata({
title = 'PDF-Ai - the SaaS for students',
title = 'PDF-Ai - the Ai Chat SaaS ',
description = 'Quill is an open-source software to make chatting to your PDF files easy.',
image = '/thumbnail.png',
icons = '/favicon.ico',
Expand Down

0 comments on commit fb8bb12

Please sign in to comment.