-
Notifications
You must be signed in to change notification settings - Fork 277
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
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
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 }} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 🤔
There was a problem hiding this comment.
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. Theinputs
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