-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (56 loc) · 1.56 KB
/
Copy pathdeploy.yml
File metadata and controls
69 lines (56 loc) · 1.56 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Deploy to Self-Hosted Server
on:
push:
branches: [main, master]
workflow_dispatch:
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install
- name: Build
run: bun run build
env:
VITE_SUPABASE_URL: ${{ secrets.VITE_SUPABASE_URL }}
VITE_SUPABASE_PUBLISHABLE_KEY: ${{ secrets.VITE_SUPABASE_PUBLISHABLE_KEY }}
VITE_SUPABASE_PROJECT_ID: ${{ secrets.VITE_SUPABASE_PROJECT_ID }}
- name: Upload dist artifact
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
retention-days: 1
deploy:
name: Deploy to webftp.ssmg4.dpdns.org
needs: build
runs-on: self-hosted
steps:
- name: Download dist artifact
uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- name: Deploy frontend to web root
run: |
rsync -a --delete dist/ ${{ secrets.DEPLOY_PATH }}/
- name: Update server code
run: |
cd /var/www/webftp
git fetch origin
git checkout -- .
git pull --ff-only
- name: Install server dependencies
run: |
cd /var/www/webftp/server
npm install --omit=dev --no-audit --no-fund
- name: Restart proxy server
run: |
pm2 restart webftp-proxy