38 lines
689 B
YAML
38 lines
689 B
YAML
name: Build frontend
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
```
|
|
steps:
|
|
- name: Clone repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
repository: Rahaf/SweetHome
|
|
github-server-url: http://45.93.137.91:3000
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
|
|
- name: Install dependencies (ignore peer conflicts)
|
|
run: npm install --legacy-peer-deps
|
|
|
|
- name: Generate build
|
|
run: npm run build
|
|
|
|
- name: Copy to Nginx root
|
|
run: |
|
|
sudo rm -rf /var/www/html/*
|
|
sudo cp -r dist/* /var/www/html/
|
|
sudo chown -R www-data:www-data /var/www/html/
|
|
sudo systemctl reload nginx
|
|
```
|