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: 54 additions & 0 deletions .github/workflows/openapi-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: OpenAPI publish

on:
push:
branches: [main]

jobs:
publish:
name: Generate and publish OpenAPI
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: npm
- run: npm ci
- run: npm run openapi:gen
- run: |
mkdir -p ./openapi-site
cp openapi.json ./openapi-site/openapi.json
cat > ./openapi-site/index.html <<'EOF'
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Lens OpenAPI</title>
<link rel="stylesheet" href="https://unpkg.com/swagger-ui-dist/swagger-ui.css" />
</head>
<body>
<div id="swagger-ui"></div>
<script src="https://unpkg.com/swagger-ui-dist/swagger-ui-bundle.js"></script>
<script>
window.onload = () => {
window.ui = SwaggerUIBundle({
url: 'openapi.json',
dom_id: '#swagger-ui',
presets: [SwaggerUIBundle.presets.apis],
layout: 'BaseLayout'
})
}
</script>
</body>
</html>
EOF
- uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./openapi-site
publish_branch: gh-pages
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Stage 1: Build
FROM node:20-alpine AS builder
FROM node:20-slim AS builder

WORKDIR /app

Expand All @@ -13,12 +13,12 @@ COPY . .
RUN npm run build

# Stage 2: Run
FROM node:20-alpine
FROM node:20-slim

WORKDIR /app

# Install curl for healthcheck
RUN apk add --no-cache curl
RUN apt-get update && apt-get install -y --no-install-recommends curl && rm -rf /var/lib/apt/lists/*

# Copy production dependencies
COPY package*.json ./
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ Or interactively at [http://localhost:3002/graphiql](http://localhost:3002/graph

## Documentation
Detailed system design and data flow diagrams can be found in the [Architecture Overview](docs/architecture.md).
The API specification is available in [OpenAPI 3.0 format](openapi.yaml).
The API specification is available in [OpenAPI 3.0 format](openapi.yaml) and is auto-published to GitHub Pages at https://miracle656.github.io/lens/openapi.json.

## Examples

Expand Down
3 changes: 1 addition & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3.9"

services:
lens:
build: .
Expand All @@ -9,6 +7,7 @@ services:
- DATABASE_URL=postgresql://lens:lens@postgres:5432/lens
- REDIS_URL=redis://redis:6379
- WATCHED_PAIRS=XLM:native/USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5
- REQUIRE_API_KEY=false
depends_on:
postgres:
condition: service_healthy
Expand Down
Loading