chore: add LICENSE (BUSL) #5
Workflow file for this run
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
| name: Release docker image | |
| on: | |
| push: | |
| tags: | |
| - v** | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| id-token: write | |
| contents: read | |
| env: | |
| AWS_ACCOUNT_ID: "981432137740" | |
| AWS_REGION: us-east-1 | |
| DOCKERHUB_REPO: injectivelabs/evm-gateway | |
| PUBLIC_ECR_REPO: public.ecr.aws/l9h3g6c6/evm-gateway | |
| RELEASE_TAG: ${{ github.ref_name }} | |
| jobs: | |
| build-image-at-tag: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: blacksmith-2vcpu-ubuntu-2404 | |
| platform: linux/amd64 | |
| arch: amd64 | |
| - os: blacksmith-2vcpu-ubuntu-2404-arm | |
| platform: linux/arm64 | |
| arch: arm64 | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 60 | |
| outputs: | |
| digest_amd64: ${{ steps.capture-digest.outputs.digest_amd64 }} | |
| digest_arm64: ${{ steps.capture-digest.outputs.digest_arm64 }} | |
| steps: | |
| - name: Checkout evm-gateway | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 1 | |
| - name: Compute build metadata | |
| id: meta | |
| run: | | |
| VERSION_PKG=github.com/InjectiveLabs/evm-gateway/version | |
| VERSION_FLAGS="-X ${VERSION_PKG}.AppVersion=${RELEASE_TAG} -X ${VERSION_PKG}.GitCommit=$(git rev-parse --short HEAD) -X ${VERSION_PKG}.BuildDate=$(date -u +%Y%m%d-%H%M)" | |
| { | |
| echo "version_flags<<EOF" | |
| echo "${VERSION_FLAGS}" | |
| echo "EOF" | |
| } >> "$GITHUB_OUTPUT" | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Login to DockerHub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Configure AWS credentials via OIDC | |
| uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| role-to-assume: arn:aws:iam::${{ env.AWS_ACCOUNT_ID }}:role/evm-gateway | |
| aws-region: ${{ env.AWS_REGION }} | |
| audience: sts.amazonaws.com | |
| - name: Login to Amazon ECR Public | |
| uses: aws-actions/amazon-ecr-login@v2 | |
| with: | |
| registry-type: public | |
| - name: Build and push image | |
| id: build | |
| uses: docker/build-push-action@v6 | |
| with: | |
| platforms: ${{ matrix.platform }} | |
| context: . | |
| file: ./Dockerfile | |
| build-args: | | |
| VERSION_FLAGS=${{ steps.meta.outputs.version_flags }} | |
| tags: | | |
| ${{ env.DOCKERHUB_REPO }}:${{ env.RELEASE_TAG }} | |
| ${{ env.PUBLIC_ECR_REPO }}:${{ env.RELEASE_TAG }} | |
| push: true | |
| outputs: type=image,name=${{ env.DOCKERHUB_REPO }},digest=true | |
| - name: Capture image digest | |
| id: capture-digest | |
| run: echo "digest_${{ matrix.arch }}=${{ steps.build.outputs.digest }}" >> "$GITHUB_OUTPUT" | |
| merge: | |
| runs-on: blacksmith-2vcpu-ubuntu-2404 | |
| timeout-minutes: 30 | |
| needs: build-image-at-tag | |
| steps: | |
| - name: Debug output digests | |
| run: | | |
| echo "AMD64 Digest: ${{ needs.build-image-at-tag.outputs.digest_amd64 }}" | |
| echo "ARM64 Digest: ${{ needs.build-image-at-tag.outputs.digest_arm64 }}" | |
| - name: Login to DockerHub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Configure AWS credentials via OIDC | |
| uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| role-to-assume: arn:aws:iam::${{ env.AWS_ACCOUNT_ID }}:role/evm-gateway | |
| aws-region: ${{ env.AWS_REGION }} | |
| audience: sts.amazonaws.com | |
| - name: Login to Amazon ECR Public | |
| uses: aws-actions/amazon-ecr-login@v2 | |
| with: | |
| registry-type: public | |
| - name: Create multi-arch manifests | |
| run: | | |
| docker buildx imagetools create \ | |
| --tag ${{ env.DOCKERHUB_REPO }}:${{ env.RELEASE_TAG }} \ | |
| ${{ env.DOCKERHUB_REPO }}@${{ needs.build-image-at-tag.outputs.digest_amd64 }} \ | |
| ${{ env.DOCKERHUB_REPO }}@${{ needs.build-image-at-tag.outputs.digest_arm64 }} | |
| docker buildx imagetools create \ | |
| --tag ${{ env.PUBLIC_ECR_REPO }}:${{ env.RELEASE_TAG }} \ | |
| ${{ env.PUBLIC_ECR_REPO }}@${{ needs.build-image-at-tag.outputs.digest_amd64 }} \ | |
| ${{ env.PUBLIC_ECR_REPO }}@${{ needs.build-image-at-tag.outputs.digest_arm64 }} |