Skip to content

Commit

Permalink
ci(docker): added docker workflow and updated some config variables t…
Browse files Browse the repository at this point in the history
…o env

fix(workflow): docker push workflow fix

feat(ci): updateing to use tags got actions instead of commit hashes

fix(docker): updated the actions to use pat

feat(actions): print env variables
  • Loading branch information
arhamj committed Oct 21, 2024
1 parent f3415d6 commit 269934e
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 6 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Create and publish a Docker image

on:
push:
branches: ['dev']
pull_request:
branches: ['dev']

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.PAT_TOKEN }} # ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
id: push
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- 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
12 changes: 6 additions & 6 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export const CONFIG: Config = {
port: Number(process.env.LOG_SERVER_PORT) || 4446,
},
ip: '0.0.0.0',
port: 8080,
port: Number(process.env.RPC_PORT) || 8080,
chainId: 8082,
nodeIpInfo: {
externalIp: process.env.NODE_EXTERNAL_IP || '127.0.0.1',
Expand All @@ -131,23 +131,23 @@ export const CONFIG: Config = {
askLocalHostForArchiver: true,
rotationInterval: 60,
faucetServerUrl: process.env.FAUCET_URL || 'https://faucet.liberty10.shardeum.org',
queryFromValidator: true,
queryFromValidator: Boolean(process.env.QUERY_FROM_VALIDATOR) || true,
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,
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,
staticGasEstimate: '0x5B8D80', // comment out rather than delete this line
staticGasEstimate: process.env.STATIC_GAS_ESTIMATE || '0x5B8D80', // comment out rather than delete this line
defaultRequestTimeout: {
default: 2000,
contract: 7000,
account: 10000,
full_nodelist: 10000,
},
aalgWarmup: false,
aalgWarmup: Boolean(process.env.AALG_WARMUP) || true,
aalgWarmupServiceTPS: 10,
recordTxStatus: false, // not safe for production, keep this off. Known issue.
rateLimit: false,
Expand Down

0 comments on commit 269934e

Please sign in to comment.