-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (39 loc) · 1.07 KB
/
ci.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
name: CI
on:
push:
branches: [main]
jobs:
test:
name: Test, Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: "20.x"
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Prepare
run: pnpm install
- name: Test
run: pnpm test
- name: Build
run: pnpm build
- name: Deploy Web
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build/public
- name: Deploy Core
env:
REMOTE_SSH_KEY: ${{ secrets.REMOTE_SSH_KEY }}
REMOTE_IP: ${{ secrets.REMOTE_IP }}
run: |
eval $(ssh-agent -s)
ssh-add <(echo "$REMOTE_SSH_KEY")
scp -r -o "StrictHostKeyChecking no" build/* "$REMOTE_IP":/home/beta_amadeus
ssh -o "StrictHostKeyChecking no" "$REMOTE_IP" "rm -rf /home/beta_amadeus/public"
ssh-agent -k