-
Notifications
You must be signed in to change notification settings - Fork 15
SHARD-913 Added ENV for config and Docker image building workflow #74 #77
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
8 commits
Select commit
Hold shift + click to select a range
8b89fbc
ci(docker): added docker workflow and updated some config variables t…
arhamj c4ac1dd
ci(docker): updated docker workflow to simplify
arhamj 91b8efe
fix(patches): updated local setting patches
arhamj 0b71793
ci(workflow): addded a dispatcher trigger for docker image build
arhamj f60cd74
ci(docker): use custom tag for manual workflow triggers
arhamj f88e357
fixed docker image tag
aniketdivekar cbb5082
add feature branch to test build
chrypnotoad 4985efd
Revert "add feature branch to test build"
chrypnotoad 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,73 @@ | ||
name: Create and publish a Docker image | ||
|
||
on: | ||
push: | ||
branches: ['dev'] | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
description: 'Tag for the Docker image' | ||
required: true | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
display-image-name: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Display IMAGE_NAME | ||
run: echo "IMAGE_NAME is ${{ env.IMAGE_NAME }}" | ||
build-and-push-image: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
attestations: write | ||
id-token: write | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Log in to the Container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Get short commit hash and determine branch name | ||
id: set-env-vars | ||
run: | | ||
# Get short commit hash | ||
echo "SHORT_COMMIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV | ||
# Determine branch name | ||
if [ "${{ github.event_name }}" == "pull_request" ]; then | ||
echo "BRANCH_NAME=${{ github.head_ref }}" >> $GITHUB_ENV # Source branch of the PR | ||
else | ||
echo "BRANCH_NAME=${{ github.ref_name }}" >> $GITHUB_ENV # Actual branch name for push events | ||
fi | ||
- name: Set Docker image tag | ||
id: set-docker-tag | ||
run: | | ||
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then | ||
echo "DOCKER_TAG=${{ github.event.inputs.tag }}" >> $GITHUB_ENV | ||
else | ||
echo "DOCKER_TAG=${{ env.BRANCH_NAME }}-${{ env.SHORT_COMMIT_HASH }}" >> $GITHUB_ENV | ||
fi | ||
- name: Build and push Docker image | ||
id: push | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
file: Dockerfile | ||
push: true | ||
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.DOCKER_TAG }} | ||
labels: | | ||
version=${{ env.SHORT_COMMIT_HASH }} | ||
branch=${{ env.BRANCH_NAME }} | ||
- name: Generate artifact attestation | ||
uses: actions/attest-build-provenance@v1 | ||
with: | ||
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}} | ||
subject-digest: ${{ steps.push.outputs.digest }} | ||
push-to-registry: true |
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
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 |
---|---|---|
@@ -1,14 +1,15 @@ | ||
diff --git a/src/config.ts b/src/config.ts | ||
--- a/src/config.ts (revision e0fd622f7257642c37243f3da9303dfaa55c1872) | ||
+++ b/src/config.ts (date 1713205409743) | ||
@@ -131,8 +131,8 @@ | ||
index a633cf3..8c3df19 100644 | ||
--- a/src/config.ts | ||
+++ b/src/config.ts | ||
@@ -135,8 +135,8 @@ export const CONFIG: Config = { | ||
explorerUrl: process.env.EXPLORER_URL || 'http://127.0.0.1:6001', | ||
queryFromExplorer: false, | ||
generateTxTimestamp: true, | ||
- nodelistRefreshInterval: 30000, | ||
- nodelistRefreshInterval: Number(process.env.NODELIST_REFRESH_INTERVAL) || 30000, | ||
- defaultRequestRetry: 5, | ||
+ nodelistRefreshInterval: 5000, | ||
+ defaultRequestRetry: 10, | ||
gasEstimateMethod: 'serviceValidator', //serviceValidator or replayEngine or validator | ||
gasEstimateMethod: process.env.GAS_ESTIMATE_METHOD || 'serviceValidator', //serviceValidator or replayEngine or validator | ||
gasEstimateInvalidationIntervalInMs: 1000 * 60 * 60 * 2, // 2 hours | ||
gasEstimateUseCache: false, |
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.