forked from logto-io/logto
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (41 loc) · 1.32 KB
/
deploy-dev.yml
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
name: Deploy Dev
on:
push:
branches: [ master ]
jobs:
deploy:
environment: dev
concurrency: deploy-dev
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node and pnpm
uses: logto-io/[email protected]
- name: Build
run: pnpm -- lerna run build --stream
# See warning in https://pnpm.io/cli/prune
- name: Prune
run: rm -rf node_modules packages/*/node_modules && pnpm i
env:
NODE_ENV: production
- name: Setup env
working-directory: packages/core
run: echo "$DEV_CORE_ENV" >> .env
env:
DEV_CORE_ENV: ${{ secrets.DEV_CORE_ENV }}
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.DEV_SSH_KEY }}
known_hosts: ${{ secrets.DEV_SSH_KNOWN_HOSTS }}
config: ${{ secrets.DEV_SSH_CONFIG }}
- name: Rsync folder
run: rsync --filter='exclude .git' -r -a --delete-before --ignore-times ./ $DEV_SERVER_IP:~/logto
env:
DEV_SERVER_IP: ${{ secrets.DEV_SERVER_IP }}
- name: Sleep for 5 seconds
run: sleep 5s
- name: Health check
run: curl $DEV_SERVER_URL/api/status -If
env:
DEV_SERVER_URL: ${{ secrets.DEV_SERVER_URL }}