Repository navigation
99 lines (84 loc) · 4.03 KB
/
Copy pathmain.yml
File metadata and controls
99 lines (84 loc) · 4.03 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: CI
on:
push:
branches: [ main ]
jobs:
deploy:
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Read .nvmrc
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
id: nvm
- name: Setup Node.js
uses: actions/setup-node@master
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install:ci
- name: Build
run: yarn build
- name: "Copy node build artifacts to production server 1"
uses: appleboy/scp-action@master
with:
host: ${{ secrets.SSH_HOST_1_PROD }}
username: ${{ secrets.SSH_USERNAME_PROD }}
key: ${{ secrets.DEPLOYMENT_KEY_PROD }}
port: ${{ secrets.SSH_PORT_PROD }}
source: "./nodes/persistence-node/bin,./nodes/persistence-node/node_modules,./nodes/ens-contenthash-indexer-node/bin,./nodes/ens-contenthash-indexer-node/node_modules,./nodes/ens-text-record-indexer/bin,./nodes/ens-text-record-indexer/node_modules"
target: "/home/ubuntu/staging/polywrap/nodes"
- name: "Copy node build artifacts to production server 2"
uses: appleboy/scp-action@master
with:
host: ${{ secrets.SSH_HOST_2_PROD }}
username: ${{ secrets.SSH_USERNAME_PROD }}
key: ${{ secrets.DEPLOYMENT_KEY_PROD }}
port: ${{ secrets.SSH_PORT_PROD }}
source: "./nodes/persistence-node/bin,./nodes/persistence-node/node_modules,./nodes/ens-contenthash-indexer-node/bin,./nodes/ens-contenthash-indexer-node/node_modules,./nodes/ens-text-record-indexer/bin,./nodes/ens-text-record-indexer/node_modules"
target: "/home/ubuntu/staging/polywrap/nodes"
- name: "Copy node build artifacts to production server 3"
uses: appleboy/scp-action@master
with:
host: ${{ secrets.SSH_HOST_3_PROD }}
username: ${{ secrets.SSH_USERNAME_PROD }}
key: ${{ secrets.DEPLOYMENT_KEY_PROD }}
port: ${{ secrets.SSH_PORT_PROD }}
source: "./nodes/persistence-node/bin,./nodes/persistence-node/node_modules,./nodes/ens-contenthash-indexer-node/bin,./nodes/ens-contenthash-indexer-node/node_modules,./nodes/ens-text-record-indexer/bin,./nodes/ens-text-record-indexer/node_modules"
target: "/home/ubuntu/staging/polywrap/nodes"
- name: Deploy nodes to production server 1
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST_1_PROD }}
username: ${{ secrets.SSH_USERNAME_PROD }}
key: ${{ secrets.DEPLOYMENT_KEY_PROD }}
port: ${{ secrets.SSH_PORT_PROD }}
script: |
curl -o- https://raw.githubusercontent.com/polywrap/nodes/main/deployment/prod/update.sh | bash
- name: Deploy nodes to production server 2
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST_2_PROD }}
username: ${{ secrets.SSH_USERNAME_PROD }}
key: ${{ secrets.DEPLOYMENT_KEY_PROD }}
port: ${{ secrets.SSH_PORT_PROD }}
script: |
curl -o- https://raw.githubusercontent.com/polywrap/nodes/main/deployment/prod/update.sh | bash
- name: Deploy nodes to production server 3
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST_3_PROD }}
username: ${{ secrets.SSH_USERNAME_PROD }}
key: ${{ secrets.DEPLOYMENT_KEY_PROD }}
port: ${{ secrets.SSH_PORT_PROD }}
script: |
curl -o- https://raw.githubusercontent.com/polywrap/nodes/main/deployment/prod/update.sh | bash