-
Notifications
You must be signed in to change notification settings - Fork 2
82 lines (68 loc) · 2.25 KB
/
Copy pathrelease.yml
File metadata and controls
82 lines (68 loc) · 2.25 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
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Publish ReactEdge Platform
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
environment: reactedge
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Setup SSH
run: |
mkdir -p ~/.ssh
echo "${{ secrets.WIDGET_SSH_KEY }}" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
if [ -z "${{ secrets.WIDGET_SSH_HOST }}" ]; then
echo "ERROR: WIDGET_SSH_HOST not set (environment secrets not visible)"
exit 1
fi
ssh-keyscan -H "${{ secrets.WIDGET_SSH_HOST }}" >> ~/.ssh/known_hosts
- name: Install CDN dependencies
working-directory: ./services/cdn
run: npm ci
- name: Build CSS bundles
working-directory: ./services/cdn
run: npx tsx scripts/build-all-css-bundles.ts
- name: Sync CDN assets
run: |
rsync -avz --delete \
./services/cdn/www/ \
${{ secrets.WIDGET_SSH_USER }}@${{ secrets.WIDGET_SSH_HOST }}:/var/www/cdn/
- name: Sync SSR runtime
run: |
rsync -avz --delete \
--exclude ".git" \
--exclude "code" \
--exclude "node_modules" \
--exclude ".github" \
--exclude ".env" \
./services/ssr/ \
${{ secrets.WIDGET_SSH_USER }}@${{ secrets.WIDGET_SSH_HOST }}:/var/www/ssr/
- name: Install and restart SSR
run: |
ssh ${{ secrets.WIDGET_SSH_USER }}@${{ secrets.WIDGET_SSH_HOST }} << 'EOF'
cd /var/www/ssr
npm ci
npm run build
pm2 restart widgets-ssr || pm2 start npm --name "widgets-ssr" -- run start
pm2 save
EOF
- name: Sync widget source
run: |
rsync -avz --delete \
--exclude "node_modules" \
--exclude "dist" \
--exclude "coverage" \
--exclude "test-results" \
--exclude ".git" \
--exclude ".github" \
./widgets/ \
${{ secrets.WIDGET_SSH_USER }}@${{ secrets.WIDGET_SSH_HOST }}:/var/www/widgets_src/