-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (39 loc) · 1.12 KB
/
deploy.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
49
50
51
name: Deploy React App
on:
push:
branches:
- dev # Adjust this to your main branch
jobs:
deploy:
runs-on: dev
defaults:
run:
working-directory: ./frontend
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: "18.17.1" # Adjust this to your required Node version
- name: Install Pnpm
run: npm install -g pnpm
- name: Install dependencies
run: pnpm install
- name: Format code
run: pnpm format
- name: Lint code
run: pnpm oxlint
- name: Run tests
run: pnpm run test
- name: Build project
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
run: NODE_OPTIONS="--max-old-space-size=4096" pnpm run build
- name: Postbuild project
run: pnpm run postbuild
- name: Deploy to server
run: |
rm -rf /var/www/INSIGHTS/frontend/dist/*
cp -r ./frontend/dist/* /var/www/INSIGHTS/frontend/dist
sudo systemctl restart nginx