-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (37 loc) · 1.05 KB
/
nextjs-cd.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Next.js CD
concurrency:
group: production
cancel-in-progress: true
on:
push:
branches:
- main
paths-ignore:
- '.github/**'
workflow_dispatch:
jobs:
build-and-deploy:
runs-on: self-hosted
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
- name: Disable Next.js Telemetry
run: npx next telemetry disable
- name: Build
run: npm run build
env:
GA_ID: ${{ secrets.GA_ID }}
- name: Restart PM2
run: pm2 restart all