Skip to content

Commit

Permalink
Update nextjs-package-test.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Fun117 committed Oct 22, 2024
1 parent 43450dc commit bc5b515
Showing 1 changed file with 20 additions and 14 deletions.
34 changes: 20 additions & 14 deletions .github/workflows/nextjs-package-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,39 @@ jobs:
runs-on: ubuntu-latest

env:
SCRATCH_AUTH_SECRET_KEY: ${{ secrets.SCRATCH_AUTH_SECRET_KEY }}
NEXT_PUBLIC_REDIRECT_URL: "http://localhost:3000/api/auth"
SCRATCH_AUTH_SECRET_KEY: ${{ secrets.SCRATCH_AUTH_SECRET_KEY }} # Ensure secrets are set

services:
scratch-auth:
image: scratch-auth/scratch-auth:latest
ports:
- 4000:4000

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: "18"

- name: Install dependencies
- name: Install dependencies for nextjs package
working-directory: packages/nextjs
run: npm install

- name: Run build
- name: Link nextjs package
run: |
npm link
cd ../test/nextjs
npm link nextjs
- name: Install dependencies for test package
working-directory: test/nextjs
run: npm install

- name: Run build for nextjs package
working-directory: packages/nextjs
run: npm run build

Expand All @@ -54,11 +64,7 @@ jobs:
- name: Stop services
run: |
if lsof -t -i:3000; then
kill $(lsof -t -i:3000)
else
echo "No process running on port 3000"
fi
kill $(lsof -t -i:3000) || true
if: always()

- name: Upload test results
Expand Down

0 comments on commit bc5b515

Please sign in to comment.