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
51 changes: 51 additions & 0 deletions .github/workflows/rainix-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Docker image CI

on:
push:
workflow_dispatch:
inputs:
tag:
description: 'Tag to give the build. Try to make it unique.'
required: true

env:
CHANNEL: ${{ inputs.tag || github.head_ref || github.ref_name }}
DOCKER_BUILDKIT: 1
COMPOSE_DOCKER_CLI_BUILD: 1
TAG_BASE: rainprotocol/pyth-crosschain

jobs:
build:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0

- name: Install Nix 1/2
uses: DeterminateSystems/nix-installer-action@main
with:
determinate: true
- name: Install Nix 2/2
uses: DeterminateSystems/flakehub-cache-action@main

- name: Install deps
run: nix develop -c pnpm install --frozen-lockfile

- name: Build Price Pusher
run: nix develop -c pnpm turbo build --filter @pythnetwork/price-pusher

- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- run: |
rm .dockerignore
docker build -t "$TAG_BASE:$CHANNEL" --build-arg GIT_SHA=${{ github.sha }} --build-arg DOCKER_CHANNEL=$CHANNEL .
- run: |
docker push "$TAG_BASE:$CHANNEL"
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM node:22.14

# set git sha and docker tag form build time arg to run time env in container
ARG GIT_SHA
ARG DOCKER_CHANNEL
ENV GIT_COMMIT=$GIT_SHA
ENV DOCKER_TAG=$DOCKER_CHANNEL

WORKDIR /price-pusher
ADD . .

WORKDIR apps/price_pusher
CMD ["bash", "-c", "npm run start evm -- \
--price-config-file ./price-config.stable.sample.yaml \
--endpoint \"${ENDPOINT}\" \
--pyth-contract-address \"${PYTH_CONTRACT_ADDRESS}\" \
--price-service-endpoint \"${PRICE_SERVICE_ENDPOINT}\" \
--mnemonic-file <(echo \"${MNEMONIC}\") \
--pushing-frequency \"${PUSHING_FREQUENCY:-300}\" \
--polling-frequency \"${POLLING_FREQUENCY:-5}\" \
--override-gas-price-multiplier \"${GAS_PRICE_MULTIPLIER:-1.1}\""]