Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 27 additions & 27 deletions .github/workflows/deploy-dev.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
name: Deploy develop
on:
pull_request:
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: darwinia-network/devops/actions/smart-vercel@main
name: Deploy to Vercel
with:
vercel_token: ${{ secrets.VERCEL_TOKEN }}
vercel_group: itering
preview_output: true
script_run: false
dist_path: .
project_name: msgscan
enable_cache: true
enable_notify_comment: true
enable_notify_slack: true
slack_channel: public-msgport
slack_webhook: ${{ secrets.SLACK_INCOMING_WEBHOOK_URL }}
name: Deploy develop

on:
pull_request:

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: darwinia-network/devops/actions/smart-vercel@main
name: Deploy to Vercel
with:
vercel_token: ${{ secrets.VERCEL_TOKEN }}
vercel_group: itering
preview_output: true
script_run: false
dist_path: packages/web
project_name: msgscan
enable_cache: true
enable_notify_comment: true
enable_notify_slack: true
slack_channel: public-msgport
slack_webhook: ${{ secrets.SLACK_INCOMING_WEBHOOK_URL }}

58 changes: 29 additions & 29 deletions .github/workflows/deploy-prd.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
name: Deploy production
on:
push:
tags:
- 'v*'
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: darwinia-network/devops/actions/smart-vercel@main
name: Deploy to Vercel
with:
vercel_token: ${{ secrets.VERCEL_TOKEN }}
vercel_group: itering
preview_output: true
script_run: false
dist_path: .
project_name: msgscan
prod_mode: true
enable_cache: true
enable_notify_slack: true
slack_channel: public-msgport
slack_webhook: ${{ secrets.SLACK_INCOMING_WEBHOOK_URL }}
name: Deploy production

on:
push:
tags:
- 'v*'

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: darwinia-network/devops/actions/smart-vercel@main
name: Deploy to Vercel
with:
vercel_token: ${{ secrets.VERCEL_TOKEN }}
vercel_group: itering
preview_output: true
script_run: false
dist_path: packages/web
project_name: msgscan
prod_mode: true
enable_cache: true
enable_notify_slack: true
slack_channel: public-msgport
slack_webhook: ${{ secrets.SLACK_INCOMING_WEBHOOK_URL }}

54 changes: 27 additions & 27 deletions .github/workflows/deploy-stg.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
name: Deploy staging
on:
push:
branches: [main]
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: darwinia-network/devops/actions/smart-vercel@main
name: Deploy to Vercel
with:
vercel_token: ${{ secrets.VERCEL_TOKEN }}
vercel_group: itering
preview_output: true
script_run: false
dist_path: .
project_name: msgscan
enable_cache: true
enable_notify_slack: true
slack_channel: public-msgport
slack_webhook: ${{ secrets.SLACK_INCOMING_WEBHOOK_URL }}
name: Deploy staging

on:
push:
branches: [main]

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: darwinia-network/devops/actions/smart-vercel@main
name: Deploy to Vercel
with:
vercel_token: ${{ secrets.VERCEL_TOKEN }}
vercel_group: itering
preview_output: true
script_run: false
dist_path: packages/web
project_name: msgscan
enable_cache: true
enable_notify_slack: true
slack_channel: public-msgport
slack_webhook: ${{ secrets.SLACK_INCOMING_WEBHOOK_URL }}

46 changes: 46 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Release

on:
push:
tags:
- "v*"
workflow_dispatch:

env:
DOCKER_REGISTRY: ghcr.io

jobs:

build-image:
name: Build image
runs-on: ubuntu-latest
strategy:
matrix:
image:
- indexer
steps:
- uses: actions/checkout@v4

- name: Docker login
uses: docker/login-action@v1
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ${{ env.DOCKER_REGISTRY }}

- uses: benjlevesque/short-sha@v1.2
- uses: olegtarasov/get-tag@v2.1

- name: Publish docker image hash
uses: docker/build-push-action@v6
with:
push: true
file: docker/${{ matrix.image }}.Dockerfile
tags: ${{ env.DOCKER_REGISTRY }}/${{ github.repository }}/${{ matrix.image }}:sha-${{ env.SHA }}

- name: Publish docker image tag
if: startsWith(github.ref, 'refs/tags/v')
run: |
IMAGE_TAG_HASH=${{ env.DOCKER_REGISTRY }}/${{ github.repository }}/${{ matrix.image }}
docker tag ${IMAGE_TAG_HASH}:sha-${{ env.SHA }} ${IMAGE_TAG_HASH}:${{ env.GIT_TAG_NAME }}
docker push ${IMAGE_TAG_HASH}:${{ env.GIT_TAG_NAME }}
61 changes: 24 additions & 37 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,40 +1,27 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts

# Serwist
public/sw*
public/swe-worker*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

.data
*.local.*
8 changes: 0 additions & 8 deletions .vscode/settings.json

This file was deleted.

21 changes: 21 additions & 0 deletions docker/indexer.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM node:22-alpine

WORKDIR /app

ARG S6_OVERLAY_VERSION=3.2.0.2

ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz /tmp
RUN tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz
ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-x86_64.tar.xz /tmp
RUN tar -C / -Jxpf /tmp/s6-overlay-x86_64.tar.xz

COPY packages/indexer .
COPY docker/services.d /etc/services.d

RUN npm i -g @subsquid/cli \
&& yarn install \
&& yarn build \
&& yarn cache clean \
&& npm cache clean --force

ENTRYPOINT ["/init"]
5 changes: 5 additions & 0 deletions docker/services.d/graphql/finish
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
#


echo 'graphql server died'
5 changes: 5 additions & 0 deletions docker/services.d/graphql/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/command/execlineb -P
#

s6-envdir /var/run/s6/container_environment
/bin/sh -f /app/scripts/graphql-server.sh
5 changes: 5 additions & 0 deletions docker/services.d/indexer/finish
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
#


echo 'indexer died'
5 changes: 5 additions & 0 deletions docker/services.d/indexer/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/command/execlineb -P
#

s6-envdir /var/run/s6/container_environment
/bin/sh -f /app/scripts/start.sh
Loading
Loading