This repository has been archived by the owner on Nov 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
69 lines (60 loc) · 2.15 KB
/
deploy.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: SSH deploy
on:
# push:
# branches:
# - be-dev
workflow_dispatch:
inputs:
indexerName:
description: "Indexer Name"
required: true
default: "bsc"
type: choice
options:
- bsc
- moonbeam
- near
- harmony
- algorand
tags:
description: "deployment tags"
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: deploy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.VM_SSH_HOST }}
username: ${{ secrets.VM_SSH_USER }}
key: ${{ secrets.VM_SSH_KEY }}
script: |
echo "Deployment process started"
cd ./deploy/btp-dashboard
git checkout be-dev && git pull
pm2 stop all
cd ./packages/block-indexer && yarn
if ${{ github.event.inputs == 'bsc' }}; then
echo "Deploying BSC Indexer"
pm2 start ./packages/block-indexer/pm2.bsc.json
elif ${{ github.event.inputs == 'moonbeam' }}; then
echo "Deploying Moonbeam Indexer"
pm2 start ./packages/block-indexer/pm2.moonbeam.json
elif ${{ github.event.inputs == 'near' }}; then
echo "Deploying Near Indexer"
pm2 start ./packages/block-indexer/pm2.near.json
elif ${{ github.event.inputs == 'harmony' }}; then
echo "Deploying Harmony Indexer"
pm2 start ./packages/block-indexer/pm2.harmony.json
elif ${{ github.event.inputs == 'algorand' }}; then
echo "Deploying Algorand Indexer"
pm2 start ./packages/block-indexer/pm2.algorand.json
fi
cd ../dashboard-api && yarn
cd ../..
pm2 start ./packages/dashboard-api/pm2.json
pm2 status
pm2 save
echo "Deployment process finished"