feat: kubernetes web server (#634) #10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy DO Indexer | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Install dependencies | |
run: npm ci | |
- name: Test build | |
run: npm run build | |
deploy-indexer: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Deploy to production | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.DO_INDEXER_IP }} | |
username: ${{ secrets.DO_USER }} | |
key: ${{ secrets.DO_SSH_KEY }} | |
script: | | |
export N_PREFIX="$HOME/n"; [[ :$PATH: == *":$N_PREFIX/bin:"* ]] || PATH+=":$N_PREFIX/bin" | |
cd grants-stack-indexer | |
git fetch origin main | |
git reset --hard origin/main | |
npm install && npm run build | |
pm2 reload indexer |