feat: setup CD
This commit is contained in:
31
.gitea/workflows/deploy.yml
Normal file
31
.gitea/workflows/deploy.yml
Normal file
@@ -0,0 +1,31 @@
|
||||
name: Deploy Brew Application
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main # Change this to 'master' if that is your default branch
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: production
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Build Frontend
|
||||
run: |
|
||||
npm install
|
||||
rm -rf dist/
|
||||
npm run build
|
||||
|
||||
- name: Deploy Frontend Files
|
||||
run: |
|
||||
rm -rf /var/www/brew/dist/
|
||||
cp -r dist/ /var/www/brew/
|
||||
|
||||
- name: Restart Backend with PM2
|
||||
run: |
|
||||
cd server
|
||||
npm install
|
||||
pm2 trigger or restart brew-backend || pm2 start index.js --name "brew-backend"
|
||||
Reference in New Issue
Block a user