diff --git a/.github/workflows/ci-push-image-aylin.yml b/.github/workflows/ci-push-image-aylin.yml new file mode 100644 index 0000000000..37c16df2a2 --- /dev/null +++ b/.github/workflows/ci-push-image-aylin.yml @@ -0,0 +1,52 @@ +name: Build + Push aylin image + +on: + push: + branches: + - aylin + +defaults: + run: + shell: bash + +jobs: + build_fuji_image_aylin: + name: Build Docker Image + timeout-minutes: 60 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Get Current Tag + id: get_tag + run: echo ::set-output name=tag::$(git describe --abbrev=0 --tags) + + - name: Login to Docker hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASS }} + + - name: Build Dockerfile and Push it + run: | + TAG_END=$GITHUB_SHA + + if [ -n "$GITHUB_TAG" ]; then + TAG_END=$GITHUB_TAG + fi + + export BUILD_IMAGE_ID="${{ vars.AVALANCHE_VERSION_DEV }}-aylin-${TAG_END}" + + # Copy binary to the correct Fuji VM ID respository + echo "COPY --from=builder /build/jvrKsTB9MfYGnAXtxbzFYpXKceXr9J8J8ej6uWGrYM5tXswhJ /root/.avalanchego/plugins/jvrKsTB9MfYGnAXtxbzFYpXKceXr9J8J8ej6uWGrYM5tXswhJ" >> Dockerfile + + # Copy binary to the correct Mainnet VM ID respository + echo "COPY --from=builder /build/jvrKsTB9MfYGnAXtxbzFYpXKceXr9J8J8ej6uWGrYM5tXswhJ /root/.avalanchego/plugins/o1Fg94YujMqL75Ebrdkos95MTVjZpPpdeAp5ocEsp2X9c2FSz" >> Dockerfile + + ./scripts/build_image.sh + env: + CURRENT_BRANCH: ${{ github.head_ref || github.ref_name }} + PUSH_DOCKER_IMAGE: true + DOCKERHUB_REPO: hubbleexchange/hubblenet + GITHUB_TAG: ${{ steps.get_tag.outputs.tag }} + GITHUB_SHA: ${{ github.sha }} diff --git a/.github/workflows/push-image-release.yml b/.github/workflows/push-image-release.yml new file mode 100644 index 0000000000..fc0946ebc0 --- /dev/null +++ b/.github/workflows/push-image-release.yml @@ -0,0 +1,85 @@ +name: Build + Push release image + +on: + workflow_dispatch: + inputs: + release_tag: + description: 'Release tag' + required: true + type: string + +defaults: + run: + shell: bash + +jobs: + build_release_image: + name: Build Docker Image + timeout-minutes: 60 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Login to Docker hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASS }} + + - name: Create the Dockerfile + env: + HUBBLENET_RELEASE_TAG: ${{ inputs.release_tag }} + AVALANCHE_VERSION: ${{ vars.AVALANCHE_VERSION }} + run: | + if [ "${HUBBLENET_RELEASE_TAG:0:1}" = "v" ]; then + HUBBLENET_VERSION="${HUBBLENET_RELEASE_TAG:1}"; + HUBBLENET_RELEASE_TAG="${HUBBLENET_RELEASE_TAG}"; + else + HUBBLENET_VERSION="${HUBBLENET_RELEASE_TAG}"; + fi + + multiline_text=$(cat < Dockerfile-release + cat Dockerfile-release + + - name: Build and push release image for the mainnet + uses: docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile-release + push: true + tags: "hubbleexchange/hubblenet:${{ vars.AVALANCHE_VERSION }}-${{ inputs.release_tag }}" + build-args: | + VM_ID=o1Fg94YujMqL75Ebrdkos95MTVjZpPpdeAp5ocEsp2X9c2FSz + + + - name: Build and push release image for the fuji + uses: docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile-release + push: true + tags: "hubbleexchange/hubblenet:${{ vars.AVALANCHE_VERSION }}-fuji-${{ inputs.release_tag }}" + build-args: | + VM_ID=jvrKsTB9MfYGnAXtxbzFYpXKceXr9J8J8ej6uWGrYM5tXswhJ diff --git a/scripts/build_image.sh b/scripts/build_image.sh index 90ecccd522..9d0d00bfc4 100755 --- a/scripts/build_image.sh +++ b/scripts/build_image.sh @@ -17,6 +17,7 @@ source "$SUBNET_EVM_PATH"/scripts/versions.sh source "$SUBNET_EVM_PATH"/scripts/constants.sh BUILD_IMAGE_ID=${BUILD_IMAGE_ID:-"${AVALANCHE_VERSION}-Subnet-EVM-${CURRENT_BRANCH}"} +DOCKERHUB_REPO=${DOCKERHUB_REPO:-"avaplatform/avalanchego"} echo "Building Docker Image: $DOCKERHUB_REPO:$BUILD_IMAGE_ID based of $AVALANCHE_VERSION" docker build -t "$DOCKERHUB_REPO:$BUILD_IMAGE_ID" "$SUBNET_EVM_PATH" -f "$SUBNET_EVM_PATH/Dockerfile" \ diff --git a/scripts/constants.sh b/scripts/constants.sh index 54fe90b254..1c0d3663e2 100644 --- a/scripts/constants.sh +++ b/scripts/constants.sh @@ -8,9 +8,6 @@ set -euo pipefail # Set the PATHS GOPATH="$(go env GOPATH)" -# Avalabs docker hub -DOCKERHUB_REPO="avaplatform/avalanchego" - # if this isn't a git repository (say building from a release), don't set our git constants. if [ ! -d .git ]; then CURRENT_BRANCH=""