Skip to content

Commit

Permalink
Refactor: Test 2 with environment variable check
Browse files Browse the repository at this point in the history
  • Loading branch information
joywin2003 committed Sep 12, 2024
1 parent 5ac4ee7 commit 00a14e8
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

strategy:
matrix:
node-version: [18.x, 20.x]
node-version: [18.x, 20.x]

steps:
- name: Checkout repository
Expand All @@ -28,6 +28,18 @@ jobs:
- name: Install dependencies
run: npm install

- name: Check Environment Variables
run: |
echo "NEXT_PUBLIC_SITE_URL is set: ${{ env.NEXT_PUBLIC_SITE_URL != '' }}"
echo "NEXTAUTH_SECRET is set: ${{ env.NEXTAUTH_SECRET != '' }}"
echo "GOOGLE_ID is set: ${{ env.GOOGLE_ID != '' }}"
echo "GOOGLE_SECRET is set: ${{ env.GOOGLE_SECRET != '' }}"
env:
NEXT_PUBLIC_SITE_URL: ${{ secrets.NEXT_PUBLIC_SITE_URL }}
NEXTAUTH_SECRET: ${{ secrets.NEXTAUTH_SECRET }}
GOOGLE_ID: ${{ secrets.GOOGLE_ID }}
GOOGLE_SECRET: ${{ secrets.GOOGLE_SECRET }}

- name: Build project
run: npm run build
env:
Expand All @@ -36,7 +48,6 @@ jobs:
NEXTAUTH_SECRET: ${{ secrets.NEXTAUTH_SECRET }}
NEXT_PUBLIC_SITE_URL: ${{ secrets.NEXT_PUBLIC_SITE_URL }}

# Optionally upload build artifacts if needed
- name: Upload build artifacts (optional)
if: always()
uses: actions/upload-artifact@v3
Expand Down

0 comments on commit 00a14e8

Please sign in to comment.