From ed06d266b2808f15233cd40214d3c69fde5e354a Mon Sep 17 00:00:00 2001 From: rouzwelt Date: Mon, 29 Sep 2025 19:15:45 +0000 Subject: [PATCH 1/7] init --- .github/workflows/rainix-docker.yml | 50 +++++++++++++++++++++++++++++ Dockerfile | 21 ++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 .github/workflows/rainix-docker.yml create mode 100644 Dockerfile diff --git a/.github/workflows/rainix-docker.yml b/.github/workflows/rainix-docker.yml new file mode 100644 index 0000000000..3c844de8d6 --- /dev/null +++ b/.github/workflows/rainix-docker.yml @@ -0,0 +1,50 @@ +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: pnpm install --frozen-lockfile + + - name: Build Price Pusher + run: 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: | + docker build -t "$TAG_BASE:$CHANNEL" --build-arg GIT_SHA=${{ github.sha }} --build-arg DOCKER_CHANNEL=$CHANNEL . + - run: | + docker push "$TAG_BASE:$CHANNEL" diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000..916eed447d --- /dev/null +++ b/Dockerfile @@ -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}\""] From 6cd57d442b30a3864884b85fa25b6737c6e042b1 Mon Sep 17 00:00:00 2001 From: rouzwelt Date: Mon, 29 Sep 2025 19:18:22 +0000 Subject: [PATCH 2/7] Update rainix-docker.yml --- .github/workflows/rainix-docker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rainix-docker.yml b/.github/workflows/rainix-docker.yml index 3c844de8d6..cebf3538fc 100644 --- a/.github/workflows/rainix-docker.yml +++ b/.github/workflows/rainix-docker.yml @@ -34,10 +34,10 @@ jobs: uses: DeterminateSystems/flakehub-cache-action@main - name: Install deps - run: pnpm install --frozen-lockfile + run: nix develop -c pnpm install --frozen-lockfile - name: Build Price Pusher - run: pnpm turbo build --filter @pythnetwork/price-pusher + run: nix develop -c pnpm turbo build --filter @pythnetwork/price-pusher - uses: docker/setup-buildx-action@v2 - uses: docker/login-action@v2 From 3d5e6f20597e200957195d9deaa9192f3d456e4f Mon Sep 17 00:00:00 2001 From: rouzwelt Date: Tue, 30 Sep 2025 05:08:23 +0000 Subject: [PATCH 3/7] update --- .github/workflows/rainix-docker.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rainix-docker.yml b/.github/workflows/rainix-docker.yml index cebf3538fc..4c825194c8 100644 --- a/.github/workflows/rainix-docker.yml +++ b/.github/workflows/rainix-docker.yml @@ -45,6 +45,7 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - run: | - docker build -t "$TAG_BASE:$CHANNEL" --build-arg GIT_SHA=${{ github.sha }} --build-arg DOCKER_CHANNEL=$CHANNEL . + cd .. + docker build -t "$TAG_BASE:$CHANNEL" --build-arg GIT_SHA=${{ github.sha }} --build-arg DOCKER_CHANNEL=$CHANNEL -f pyth-crosschain/Dockerfile pyth-crosschain/ - run: | docker push "$TAG_BASE:$CHANNEL" From d8eac9cd7593a0d7df3c1332863fbac3c859595f Mon Sep 17 00:00:00 2001 From: rouzwelt Date: Tue, 30 Sep 2025 05:17:28 +0000 Subject: [PATCH 4/7] update --- .github/workflows/rainix-docker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rainix-docker.yml b/.github/workflows/rainix-docker.yml index 4c825194c8..7a480e8f30 100644 --- a/.github/workflows/rainix-docker.yml +++ b/.github/workflows/rainix-docker.yml @@ -45,7 +45,7 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - run: | - cd .. - docker build -t "$TAG_BASE:$CHANNEL" --build-arg GIT_SHA=${{ github.sha }} --build-arg DOCKER_CHANNEL=$CHANNEL -f pyth-crosschain/Dockerfile pyth-crosschain/ + 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" From bcfdfee07be9c3f6296b60cbf22087a9d55c1ab2 Mon Sep 17 00:00:00 2001 From: rouzwelt Date: Tue, 30 Sep 2025 05:46:30 +0000 Subject: [PATCH 5/7] Update Dockerfile --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 916eed447d..946fb0cadc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,9 +12,9 @@ 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}\" \ + --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}\" \ From 92d5dfcbbf2ec97e37ce67c26fb41d1319e13e5a Mon Sep 17 00:00:00 2001 From: rouzwelt Date: Tue, 30 Sep 2025 05:52:45 +0000 Subject: [PATCH 6/7] Update Dockerfile --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 946fb0cadc..1c3e0a85fc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,9 +12,9 @@ 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\" \ + --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}\" \ From d38300a8311ba05527dcde6ad3feeb8611ca055f Mon Sep 17 00:00:00 2001 From: rouzwelt Date: Tue, 30 Sep 2025 06:08:41 +0000 Subject: [PATCH 7/7] Update Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 1c3e0a85fc..0483e0e1fb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,7 @@ WORKDIR /price-pusher ADD . . WORKDIR apps/price_pusher -CMD ["bash", "-c", "npm run start evm \ +CMD ["bash", "-c", "npm run start evm -- \ --price-config-file ./price-config.stable.sample.yaml \ --endpoint \"${ENDPOINT}\" \ --pyth-contract-address \"${PYTH_CONTRACT_ADDRESS}\" \