Skip to content

Commit

Permalink
docker: update neutron docker to build custom docker image (#518)
Browse files Browse the repository at this point in the history
* update neutron docker to build custom docker image

* update docker workflow dispatch
  • Loading branch information
Anmol1696 authored Jul 10, 2024
1 parent 870da6e commit f2d09be
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 4 deletions.
29 changes: 26 additions & 3 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,25 @@ on:
- ".github/workflows/docker.yaml"
types: [opened, reopened, synchronize, ready_for_review]
workflow_dispatch:
inputs:
type:
description: 'Type of docker image to build'
type: choice
required: true
options:
- "explorers"
- "faucet"
- "relayers"
- "starship"
- "chains"
process:
description: 'Process to run'
type: string
default: "all"
version:
description: 'Version of docker image to build'
type: string
default: "all"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-docker
Expand Down Expand Up @@ -66,7 +85,7 @@ jobs:
./starship/scripts/build-docker.sh --type ${{ matrix.build-type }} --process all --version all --push
- name: Force Build and Push for workflow dispatch
if: github.event_name == 'workflow_dispatch'
if: github.event_name == 'workflow_dispatch' && github.event.inputs.type == matrix.build-type
run: |
./starship/scripts/build-docker.sh --type ${{ matrix.build-type }} --process all --version all --push --force
Expand Down Expand Up @@ -112,6 +131,10 @@ jobs:
cd docker/chains && ./build-docker-chains.sh --chain all --tag all --push
- name: Force Build and Push for workflow dispatch
if: github.event_name == 'workflow_dispatch'
if: github.event_name == 'workflow_dispatch' && github.event.inputs.type == 'chains'
run: |
cd docker/chains && ./build-docker-chains.sh --chain all --tag all --push --force
cd docker/chains && ./build-docker-chains.sh --chain $PROCESS --tag $VERSION --push --force
env:
PROCESS: ${{ github.event.inputs.process }}
VERSION: ${{ github.event.inputs.version }}

17 changes: 17 additions & 0 deletions starship/docker/chains/Dockerfile.neutron
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
ARG BASE_IMAGE

FROM ${BASE_IMAGE} as build-env

ARG VERSION

ENV CODE_REF="https://github.com/neutron-org/neutron/archive/refs/tags/${VERSION}.tar.gz"

RUN apt-get update && apt-get install -y jq xxd curl make bash jq sed

WORKDIR /opt/neutron

ADD $CODE_REF neutron.tar.gz
RUN tar --strip-components=1 -xvf neutron.tar.gz
RUN rm -rf neutron.tar.gz

RUN cd /opt/neutron && make install-test-binary
3 changes: 2 additions & 1 deletion starship/docker/chains/versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,8 @@ chains:
tags:
- v1.4.4
- name: neutron
base: ghcr.io/strangelove-ventures/heighliner/neutron
base: golang:1.21-bullseye
file: Dockerfile.neutron
tags:
- v3.0.6
- v3.0.5
Expand Down

0 comments on commit f2d09be

Please sign in to comment.