-
Notifications
You must be signed in to change notification settings - Fork 13
59 lines (48 loc) · 1.7 KB
/
deploy-dev.yaml
File metadata and controls
59 lines (48 loc) · 1.7 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
name: Deploy dev
on:
push:
branches:
- dev
jobs:
build-and-deploy:
name: Build and deploy
runs-on: [self-hosted, frontend-deploy]
env:
PATH: /root/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Build frontend (SPA)
env:
VITE_BACKEND_URL: https://app-dev.nolus.io
VITE_WS_URL: wss://app-dev.nolus.io/ws
VITE_APP_URL: https://app-dev.nolus.io
run: |
npm update web-components
npm ci
npm run build
- name: Build Rust backend
run: |
cd backend
cargo build --release
- name: Prepare deployment bundle
run: |
mkdir -p deploy-bundle
cp -r dist/ deploy-bundle/
cp backend/target/release/nolus-backend deploy-bundle/
- name: Deploy via rclone
run: |
ssh -i ~/.ssh/id_ed25519 -o StrictHostKeyChecking=no ${{ vars.DEPLOY_USER }}@${{ vars.DEPLOY_HOST }} "\
rm -f /opt/deploy/builds/app-dev/nolus-backend"
rclone sync deploy-bundle/ :sftp,host=${{ vars.DEPLOY_HOST }},user=${{ vars.DEPLOY_USER }},key_file=~/.ssh/id_ed25519:/opt/deploy/builds/app-dev/ \
--filter "- .env" \
--filter "- config/" \
--verbose
- name: Restart backend
run: |
ssh -i ~/.ssh/id_ed25519 -o StrictHostKeyChecking=no ${{ vars.DEPLOY_USER }}@${{ vars.DEPLOY_HOST }} "\
chmod +x /opt/deploy/builds/app-dev/nolus-backend && \
sudo systemctl restart webapp-dev"