Skip to content

Commit d2543ff

Browse files
committed
feat: implemented deployment workflows for digital ocean (#629)
1 parent 8dc4bcc commit d2543ff

File tree

2 files changed

+70
-0
lines changed

2 files changed

+70
-0
lines changed
+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Deploy DO Indexer
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-node@v4
15+
with:
16+
node-version: 20
17+
- name: Install dependencies
18+
run: npm ci
19+
- name: Test build
20+
run: npm run build
21+
deploy-indexer:
22+
needs: build
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v4
26+
- name: Deploy to production
27+
uses: appleboy/ssh-action@master
28+
with:
29+
host: ${{ secrets.DO_INDEXER_IP }}
30+
username: ${{ secrets.DO_USER }}
31+
key: ${{ secrets.DO_SSH_KEY }}
32+
script: |
33+
export N_PREFIX="$HOME/n"; [[ :$PATH: == *":$N_PREFIX/bin:"* ]] || PATH+=":$N_PREFIX/bin"
34+
cd grants-stack-indexer
35+
git pull origin main
36+
npm install && npm run build
37+
pm2 reload indexer

.github/workflows/deploy-do-web.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Deploy DO Web
2+
3+
on: workflow_dispatch
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
- uses: actions/setup-node@v4
11+
with:
12+
node-version: 20
13+
- name: Install dependencies
14+
run: npm ci
15+
- name: Test build
16+
run: npm run build
17+
deploy-indexer:
18+
needs: build
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
- name: Deploy to production
23+
uses: appleboy/ssh-action@master
24+
with:
25+
host: ${{ secrets.DO_WEB_IP }}
26+
username: ${{ secrets.DO_USER }}
27+
key: ${{ secrets.DO_SSH_KEY }}
28+
script: |
29+
export N_PREFIX="$HOME/n"; [[ :$PATH: == *":$N_PREFIX/bin:"* ]] || PATH+=":$N_PREFIX/bin"
30+
cd grants-stack-indexer
31+
git pull origin main
32+
npm install && npm run build
33+
pm2 reload web

0 commit comments

Comments
 (0)