Skip to content

Commit b38f2cc

Browse files
committed
Add backend deployment github action
1 parent 07ed6a6 commit b38f2cc

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Deploy Feed Data Service
2+
3+
on:
4+
push:
5+
branches:
6+
- feature/backend-deployment
7+
workflow_dispatch:
8+
9+
jobs:
10+
deploy:
11+
runs-on: ubuntu-latest
12+
environment: ${{ github.ref == 'refs/heads/feature/backend-deployment' && 'production' || 'staging' }}
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Copy backend code
19+
run: |
20+
id
21+
mkdir /home/app/dashboard-demo-backend
22+
cp -r backend/* /home/app/dashboard-demo-backend/
23+
24+
- name: Deploy via SSH
25+
uses: appleboy/ssh-action@v1.0.0
26+
with:
27+
host: ${{ secrets.SSH_HOST }}
28+
username: ${{ secrets.SSH_USER }}
29+
key: ${{ secrets.SSH_PRIVATE_KEY }}
30+
script: |
31+
cd /home/app/dashboard-demo-backend
32+
git pull origin ${{ github.ref_name }} || true
33+
docker-compose down
34+
docker-compose build
35+
docker-compose up -d
36+
docker-compose logs --tail=50 feed-data

backend/feedData.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ async function collectLatestOnce() {
235235
console.log("✅ Up to date; no new blocks to store");
236236
return { stored: 0 };
237237
}
238+
blocksToStore.reverse();
238239

239240
// Store in batches of 100
240241
console.log("\n💾 Storing new blocks in Arkiv...");

0 commit comments

Comments
 (0)