From b159e91d863bf5c555073305a387d1fcbc694de6 Mon Sep 17 00:00:00 2001 From: Filip Djokic Date: Mon, 3 Jun 2024 18:33:21 +0200 Subject: [PATCH] ci: Update GH release workflow --- .github/workflows/release.yml | 77 +++++++++++++++++++++++++++++++++-- 1 file changed, 74 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5508f64b01..4d537cd5ea 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,9 +8,10 @@ defaults: jobs: - release-docker: - name: "BigDipper Docker image" - runs-on: ubuntu-latest + release-docker-testnet: + name: "BigDipper Testnet Docker image" + runs-on: ubuntu- + if: ${{ github.ref_name == 'chains/cheqd/testnet' }} env: IMAGE_NAME: ${{ github.repository }} @@ -76,3 +77,73 @@ jobs: - name: Push BigDipper image run: docker image push --all-tags registry.digitalocean.com/${{ env.IMAGE_NAME }} + + release-docker-mainnet: + name: "BigDipper Mainnet Docker image" + runs-on: ubuntu-latest + if: ${{ github.ref_name == 'chains/cheqd/mainnet' }} + env: + IMAGE_NAME: ${{ github.repository }} + + steps: + - uses: actions/checkout@v3 + with: + persist-credentials: false + + - name: Set network name + id: set-network + run: echo NETWORK_NAME="${GITHUB_REF##*/}" >> "$GITHUB_OUTPUT" + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + id: buildx + with: + install: true + version: latest + + - name: Install DigitalOcean CLI + uses: digitalocean/action-doctl@v2 + with: + token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} + + - name: Login to DigitalOcean Container Registry + run: doctl registry login --expiry-seconds 600 + + - name: Configure Docker image metadata + id: meta + uses: docker/metadata-action@v4 + with: + images: registry.digitalocean.com/${{ env.IMAGE_NAME }} + tags: | + type=raw,value=${{ steps.set-network.outputs.NETWORK_NAME }}-latest + type=sha,format=long + labels: | + org.opencontainers.image.description="BigDipper block explorer for cheqd network" + org.opencontainers.image.source="https://github.com/cheqd/big-dipper-2.0-cosmos" + org.opencontainers.image.vendor="Cheqd Foundation Limited" + org.opencontainers.image.created={{date 'dddd, MMMM Do YYYY, h:mm:ss a'}} + org.opencontainers.image.documentation="https://product.cheqd.io/" + + - name: Build BigDipper image + uses: docker/build-push-action@v3 + with: + context: . + file: Dockerfile + platforms: linux/amd64 + load: true + target: runner + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=min + build-args: | + BASE_PATH=/ + NODE_ENV=production + NEXT_PUBLIC_CHAIN_TYPE=mainnet + NEXT_PUBLIC_GRAPHQL_URL=https://explorer-gql.cheqd.io/v1/graphql + NEXT_PUBLIC_GRAPHQL_WS=wss://explorer-gql.cheqd.io/v1/graphql + NEXT_PUBLIC_RPC_WEBSOCKET=wss://rpc.cheqd.net/websocket + PROJECT_NAME=web-cheqd + + - name: Push BigDipper image + run: docker image push --all-tags registry.digitalocean.com/${{ env.IMAGE_NAME }} \ No newline at end of file