Skip to content

Commit

Permalink
Update nextjs-cd.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
BakirGracic authored Jan 3, 2025
1 parent 7638262 commit ec4724d
Showing 1 changed file with 11 additions and 20 deletions.
31 changes: 11 additions & 20 deletions .github/workflows/nextjs-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ on:
push:
branches:
- main
paths-ignore:
- '.github/**'
workflow_dispatch:

jobs:
Expand All @@ -18,31 +16,24 @@ jobs:
environment: production

steps:
- name: Stop PM2
run: pm2 stop all

- name: Checkout
uses: actions/checkout@v4

- name: Use Node.js (22.x)
uses: actions/setup-node@v4
with:
node-version: '22.x'
cache: 'npm'

- name: Delete Old Folders
run: rm -rf node_modules/ .next/

- name: Install Dependencies
run: npm install --legacy-peer-deps
run: npm ci

- name: Disable Next.js Telemetry
run: npx next telemetry disable

- name: Build
run: npm run build
- name: Build NextJS
env:
GA_ID: ${{ secrets.GA_ID }}

- name: Restart PM2
run: pm2 restart all
run: |
npx next telemetry disable
pm2 stop 0
rm -rf .next
npm run build
- name: Start NextJS
run: |
pm2 restart 0 --update-env

0 comments on commit ec4724d

Please sign in to comment.