Repository navigation
59 lines (47 loc) · 1.5 KB
/
Copy pathrelease.yml
File metadata and controls
59 lines (47 loc) · 1.5 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: 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 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"
exit 1
fi
ssh-keyscan -H "${{ secrets.WIDGET_SSH_HOST }}" >> ~/.ssh/known_hosts
- name: Sync ReactEdge platform
run: |
rsync -avz --delete \
--exclude ".git" \
--exclude "node_modules" \
--exclude ".github" \
--exclude ".env" \
--exclude "dist" \
--exclude "coverage" \
--exclude "test-results" \
./ \
${{ secrets.WIDGET_SSH_USER }}@${{ secrets.WIDGET_SSH_HOST }}:/var/www/reactedge_platform/
- name: Install and restart SSR
run: |
ssh ${{ secrets.WIDGET_SSH_USER }}@${{ secrets.WIDGET_SSH_HOST }} << 'EOF'
set -e
cd /var/www/reactedge_platform
npm ci
cd /var/www/reactedge_platform/services/ssr
npm ci
pm2 restart widgets-ssr || \
pm2 start npm --name "widgets-ssr" -- run start
pm2 save
EOF