Skip to content

Update nextjs.yml

Update nextjs.yml #12

Workflow file for this run

name: Run Next.js Build
on:
push:
branches: ["main"]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "18.17.0" # Adjust to match your project's requirements
- name: Install dependencies
run: npm install # Or yarn install, depending on your package manager
- name: Build with Next.js
run: npm run build # Or yarn build, depending on your package manager
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: nextjs-build
path: ./out
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4