Skip to content

feat(entropy-tester): add docker image workflow #2772

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 10, 2025
Merged
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
50 changes: 50 additions & 0 deletions .github/workflows/docker-entropy-tester.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Build and Push Entropy Tester Image
on:
push:
tags:
- entropy-tester-v*
pull_request:
paths:
- "apps/entropy-tester/**"
- ".github/workflows/docker-entropy-tester.yml"
- "Dockerfile.node"
workflow_dispatch:
inputs:
dispatch_description:
description: "Dispatch description"
required: true
type: string
Comment on lines +13 to +16
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this argument here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I copy pasted it from other configs. I believe it is for manual dispatch of the job which can be useful 🤔

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you need the inputs, I think you just need workflow_dispatch with no children. The inputs creates a UI where you can fill in values when doing the manual dispatch, but you aren't actually using the input anywhere so I think it should be removed

permissions:
contents: read
id-token: write
packages: write
env:
REGISTRY: ghcr.io
IMAGE_NAME: pyth-network/entropy-tester
jobs:
entropy-tester-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set image tag to version of the git tag
if: ${{ startsWith(github.ref, 'refs/tags/entropy-tester-v') }}
run: |
PREFIX="refs/tags/entropy-tester-"
VERSION="${GITHUB_REF:${#PREFIX}}"
echo "IMAGE_TAG=${VERSION}" >> "${GITHUB_ENV}"
- name: Set image tag to the git commit hash
if: ${{ !startsWith(github.ref, 'refs/tags/entropy-tester-v') }}
run: |
echo "IMAGE_TAG=${{ github.sha }}" >> "${GITHUB_ENV}"
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build docker image
run: |
DOCKER_BUILDKIT=1 docker build --build-arg package="@pythnetwork/entropy-tester" -t ${{ env.REGISTRY }}/pyth-network/entropy-tester:${{ env.IMAGE_TAG }} -f Dockerfile.node .
- name: Push docker image
run: |
docker push ${{ env.REGISTRY }}/pyth-network/entropy-tester:${{ env.IMAGE_TAG }}