From c19ac4e17a65790450128bfdfc19cf9c7a2cc038 Mon Sep 17 00:00:00 2001 From: wsdt Date: Mon, 13 Nov 2023 05:27:50 +0100 Subject: [PATCH] feat: Force build light bridge feat: Light bridge pipeline --- .github/workflows/light-bridge-release.yml | 60 +++++++++++++++++++++ ops/docker-compose-bnb-side.yml | 4 ++ ops/docker-compose-side.yml | 4 ++ packages/boba/teleportation/src/exec/run.ts | 4 -- 4 files changed, 68 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/light-bridge-release.yml diff --git a/.github/workflows/light-bridge-release.yml b/.github/workflows/light-bridge-release.yml new file mode 100644 index 0000000000..7126239fcc --- /dev/null +++ b/.github/workflows/light-bridge-release.yml @@ -0,0 +1,60 @@ +name: Build & Release Light Bridge + +on: + workflow_dispatch: + inputs: + force: + type: boolean + default: false + required: false + description: Always execute, even if no changes have been made + release: + types: [published] + +jobs: + build_docker: + name: Build Docker Image + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: dorny/paths-filter@v2 + id: changes + with: + filters: | + src: + - 'packages/boba/teleportation/**' + + # run only if some file in 'src' folder was changed + - if: inputs.force || steps.changes.outputs.src == 'true' + name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - if: inputs.force || steps.changes.outputs.src == 'true' + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - if: inputs.force || steps.changes.outputs.src == 'true' + name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_ACCESS_TOKEN_USERNAME }} + password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN_SECRET }} + - if: inputs.force || steps.changes.outputs.src == 'true' + name: Get project versions + run: | + echo "version=$(cat ./packages/boba/teleportation/package.json | jq ".version" | tr -d '"\r\n')" >> $GITHUB_OUTPUT + id: version + + - if: inputs.force || steps.changes.outputs.src == 'true' + name: Build version specific docker image + run: cd ops && docker-compose -f docker-compose.yml -f docker-compose-side.yml build teleportation + - if: inputs.force || steps.changes.outputs.src == 'true' + name: Tag image + run: docker tag teleportation bobanetwork/lightbridge:v${{ steps.version.outputs.version }} + - if: inputs.force || steps.changes.outputs.src == 'true' + name: Push version specific docker image + run: docker push bobanetwork/lightbridge:v${{ steps.version.outputs.version }} + - if: inputs.force || steps.changes.outputs.src == 'true' + name: Tag image + run: docker tag teleportation bobanetwork/lightbridge:stable + - if: inputs.force || steps.changes.outputs.src == 'true' + name: Push stable docker image + run: docker push bobanetwork/lightbridge:stable diff --git a/ops/docker-compose-bnb-side.yml b/ops/docker-compose-bnb-side.yml index 78d5eb4a01..a3e6f6e4bf 100644 --- a/ops/docker-compose-bnb-side.yml +++ b/ops/docker-compose-bnb-side.yml @@ -116,6 +116,10 @@ services: TELEPORTATION_AWS_KMS_KEY_ID: "${TELEPORTATION_AWS_KMS_KEY_ID:-3}" TELEPORTATION_AWS_KMS_ENDPOINT: "${TELEPORTATION_AWS_KMS_ENDPOINT:-http://kms:8888/}" TELEPORTATION_AWS_KMS_REGION: "${TELEPORTATION_AWS_KMS_REGION:-us-east-1}" + # TBD best amount to airdrop + TELEPORTATION_AIRDROP_GAS_AMOUNT_WEI: 500000000000000 + TELEPORTATION_AIRDROP_COOLDOWN_SECONDS: 86400 # 86400s = 1 day + TELEPORTATION_AIRDROP_ENABLED: false teleportation_db: image: postgres diff --git a/ops/docker-compose-side.yml b/ops/docker-compose-side.yml index 4e0d28cd48..0090e6dd27 100644 --- a/ops/docker-compose-side.yml +++ b/ops/docker-compose-side.yml @@ -77,6 +77,10 @@ services: TELEPORTATION_AWS_KMS_KEY_ID: "${TELEPORTATION_AWS_KMS_KEY_ID:-3}" TELEPORTATION_AWS_KMS_REGION: "${TELEPORTATION_AWS_KMS_REGION:-us-east-1}" TELEPORTATION_AWS_KMS_ENDPOINT: "${TELEPORTATION_AWS_KMS_ENDPOINT:-http://kms:8888/}" + # TBD best amount to airdrop + TELEPORTATION_AIRDROP_GAS_AMOUNT_WEI: "500000000000000" + TELEPORTATION_AIRDROP_COOLDOWN_SECONDS: "86400" # 86400s = 1 day + TELEPORTATION_AIRDROP_ENABLED: "false" teleportation_db: image: postgres diff --git a/packages/boba/teleportation/src/exec/run.ts b/packages/boba/teleportation/src/exec/run.ts index 8c8b9d3905..df244f6bc9 100644 --- a/packages/boba/teleportation/src/exec/run.ts +++ b/packages/boba/teleportation/src/exec/run.ts @@ -66,10 +66,6 @@ const main = async () => { 'teleportation-airdrop-gas-amount-wei', env.TELEPORTATION_AIRDROP_GAS_AMOUNT_WEI || '100000000000000' // 0.0001 eth ) - const TELEPORTATION_AIRDROP_MIN_USD_VALUE = config.str( - 'teleportation-airdrop-min-usd-value', - env.TELEPORTATION_AIRDROP_MIN_USD_VALUE || '15' - ) const TELEPORTATION_AIRDROP_COOLDOWN_SECONDS = config.str( 'teleportation-airdrop-cooldown-seconds', env.TELEPORTATION_AIRDROP_COOLDOWN_SECONDS || '86400'