Skip to content
Open
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
65 changes: 65 additions & 0 deletions .github/workflows/crank-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: 🔍 Test & Deploy Crank Check Service

on:
pull_request:
branches:
- main
paths:
- "servers/crank-check/**"
push:
branches:
- main
paths:
- "servers/crank-check/**"

defaults:
run:
shell: bash

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4

- name: ⎔ Setup node
uses: actions/setup-node@v4
with:
node-version: 22

- name: 📥 Download deps
working-directory: servers/crank-check
run: npm ci

- name: 🔨 Build
working-directory: servers/crank-check
run: npm run build

publish:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
needs: [test]
permissions:
id-token: write
contents: read
packages: write
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4

- name: Log in to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Crank Check image
uses: docker/build-push-action@v4
with:
push: true
context: servers/crank-check
tags: |
ghcr.io/permaweb/ao-crank-check:latest
ghcr.io/permaweb/ao-crank-check:${{ github.sha }}
73 changes: 73 additions & 0 deletions .github/workflows/cu-verifier.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: 🔍 Test & Deploy AO CU Verifier

on:
pull_request:
branches:
- main
paths:
- "servers/cu/**"
push:
branches:
- main
paths:
- "servers/cu/**"

defaults:
run:
shell: bash

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4

- name: ⎔ Setup node
uses: actions/setup-node@v4
with:
node-version: 22

- name: 📥 Download repo deps
run: npm i

- name: 📥 Download deps
working-directory: servers/cu
run: npm i

- name: ⚡ Run Tests
working-directory: servers/cu
run: |
npm run lint
npm test
env:
CI: true

publish:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
needs: [test]
permissions:
id-token: write
contents: read
packages: write
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4

- name: Log in to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push CU Verifier image
uses: docker/build-push-action@v4
with:
push: true
context: servers/cu
file: servers/cu/Dockerfile.verifier
tags: |
ghcr.io/permaweb/ao-cu-verifier:latest
ghcr.io/permaweb/ao-cu-verifier:${{ github.sha }}
33 changes: 33 additions & 0 deletions servers/crank-check/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FROM node:22-slim AS builder

WORKDIR /app

COPY package*.json ./
RUN npm install

COPY tsconfig.json ./
COPY src ./src
RUN npm run build

# Production stage
FROM node:22-slim

WORKDIR /app

# Install build dependencies for better-sqlite3 native module
RUN apt-get update && \
apt-get install -y python3 make g++ && \
rm -rf /var/lib/apt/lists/*

COPY package*.json ./
RUN npm install --omit=dev

COPY --from=builder /app/dist ./dist

ENV NODE_ENV=production
ENV PORT=3000
ENV VERIFICATION_DB_DIR=/data/verification

EXPOSE 3000

CMD ["node", "dist/index.js"]
Loading