Skip to content

Commit

Permalink
ci: Update GH release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
filipdjokic committed Jun 3, 2024
1 parent d4812f9 commit b159e91
Showing 1 changed file with 74 additions and 3 deletions.
77 changes: 74 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand Down Expand Up @@ -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 }}

0 comments on commit b159e91

Please sign in to comment.