Skip to content

Commit

Permalink
feat: Force build light bridge
Browse files Browse the repository at this point in the history
feat: Light bridge pipeline
  • Loading branch information
wsdt committed Nov 13, 2023
1 parent ad3dae7 commit c19ac4e
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 4 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/light-bridge-release.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions ops/docker-compose-bnb-side.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions ops/docker-compose-side.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions packages/boba/teleportation/src/exec/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit c19ac4e

Please sign in to comment.