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
28 changes: 28 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# VCS / CI
.git
.github

# Local agent / editor state
.claude
.vscode
.idea
.DS_Store
CLAUDE.md

# Dependencies (rebuilt inside the image by npm ci)
node_modules

# Build artefacts (regenerated downstream)
build
generated
subgraph.yaml

# Docker / local tooling
Dockerfile
.dockerignore
docker-compose.yml
justfile

# Test outputs
tests/.bin
tests/.latest.json
51 changes: 51 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Build and upload Docker image

on:
workflow_dispatch:
push:
branches: [main]
tags: ['v*']
pull_request:
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Comment thread
RembrandtK marked this conversation as resolved.
cancel-in-progress: true

jobs:
build-image:
runs-on: ubuntu-latest
Comment thread
RembrandtK marked this conversation as resolved.
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v6
Comment thread
RembrandtK marked this conversation as resolved.

- uses: docker/setup-buildx-action@v4

- id: meta
uses: docker/metadata-action@v6
with:
images: ghcr.io/graphprotocol/indexing-payments-subgraph
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=ref,event=tag
type=sha

- uses: docker/login-action@v4
if: github.event_name != 'pull_request'
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- uses: docker/build-push-action@v7
with:
file: Dockerfile
context: .
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push: ${{ github.event_name != 'pull_request' }}
pull: true
cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/indexing-payments-subgraph:buildcache
Comment thread
RembrandtK marked this conversation as resolved.
cache-to: ${{ github.event_name != 'pull_request' && format('type=registry,ref=ghcr.io/{0}/indexing-payments-subgraph:buildcache,mode=max', github.repository_owner) || '' }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ node_modules/
tests/.bin
tests/.latest.json
subgraph.yaml
.claude/
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Packages the subgraph source and prebuilt node_modules at
# /opt/indexing-payments-subgraph. Consumed via multi-stage COPY by
# downstream deployers (e.g. edgeandnode/local-network subgraph-deploy).
#
# The image has no entrypoint: it is a source carrier, not a runtime service.

FROM node:24-bookworm-slim

WORKDIR /opt/indexing-payments-subgraph

# Install dependencies first so source edits don't invalidate this layer.
COPY package.json package-lock.json ./
RUN npm ci --ignore-scripts

COPY . .
Comment thread
RembrandtK marked this conversation as resolved.
6 changes: 6 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
services:
indexing-payments-subgraph:
image: ghcr.io/graphprotocol/indexing-payments-subgraph:${TAG:-local}
build:
context: .
dockerfile: Dockerfile
7 changes: 7 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
default:
@just --list

# Build local image consumable by downstream deployers (e.g. local-network).
# Tags as ghcr.io/graphprotocol/indexing-payments-subgraph:local.
build-image:
docker compose build
Loading