Skip to content

Commit

Permalink
ci: build/push docker images on tag push
Browse files Browse the repository at this point in the history
  • Loading branch information
youben11 committed Oct 9, 2023
1 parent 3994205 commit c24d44f
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 9 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/publish_developer_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ on:
default: "latest"
type: string
required: false
decryption_db_tag:
description: 'Decryption DB tag (default: latest)'
default: "latest"
type: string
required: false
tfhe_cli_tag:
description: 'TFHE CLI tag (default: latest)'
default: "latest"
type: string
required: false
ref_to_evmos:
description: 'Branch, tag or commit SHA1 to checkout Evmos'
required: true
Expand Down Expand Up @@ -64,6 +74,10 @@ jobs:
- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
build-arg: |
EVMOS_NODE_VERSION=${{ inputs.evmos_node_tag }}
DECRYPTION_DB_VERSION=${{ inputs.decryption_db_tag }}
TFHE_CLI_VERSION=${{ inputs.tfhe_cli_tag }}
context: .
file: docker/Dockerfile.evmos-node.developer
push: true
Expand Down
28 changes: 25 additions & 3 deletions .github/workflows/publish_docker_evmos_node.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Publish Evmos node

on:
push:
tags:
- '*'
workflow_dispatch:
inputs:
zbc_build_image_tag:
Expand Down Expand Up @@ -30,6 +33,14 @@ jobs:
with:
path: evmos

- name: Use tag from workflow disptach (if workflow dispatch)
if: github.event_name == 'workflow_dispatch'
run: echo "EVMOS_TAG=${{ inputs.evmos_node_tag }}" >> $GITHUB_ENV

- name: Use tag from tag push (if tag push)
if: github.event_name == 'push' && github.ref_type == 'tag'
run: echo "EVMOS_TAG=$GITHUB_REF_NAME" >> $GITHUB_ENV

- name: Get version for all needed repositories
working-directory: ./evmos
run: |
Expand Down Expand Up @@ -107,18 +118,29 @@ jobs:
- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
build_args: |
ZBC_VERSION=${{ inputs.zbc_build_image_tag }}
context: ./evmos
file: ./evmos/docker/Dockerfile.evmos-node.local
push: true
pull: true
platforms: linux/amd64,linux/arm64
tags: ${{ env.DOCKER_IMAGE }}:${{ inputs.evmos_node_tag }},${{ env.DOCKER_IMAGE }}:latest
tags: ${{ env.DOCKER_IMAGE }}:$EVMOS_TAG,${{ env.DOCKER_IMAGE }}:latest
labels: zbc-evmos-node

- name: Check docker images
working-directory: ./evmos
run: |
docker images
- name: Start build of dev image
shell: bash
env:
SECRET_TOKEN: ${{ secrets.CONCRETE_ACTIONS_TOKEN }}
run: |
curl -L -X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $SECRET_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/zama-ai/evmos/actions/workflows/publish_developer_image.yml/dispatches \
-d '{"ref":"v9.1.0-zama","inputs":{"evmos_node_tag":"$EVMOS_TAG", "ref_to_evmos": "$EVMOS_TAG"}}'
10 changes: 6 additions & 4 deletions docker/Dockerfile.evmos-node.developer
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@


FROM ghcr.io/zama-ai/fhevm-decryptions-db:v0.2.0 as oracle-env
FROM ghcr.io/zama-ai/fhevm-tfhe-cli:v0.2.0 as tfhe-cli

FROM ghcr.io/zama-ai/evmos-node:v0.1.9
ARG DECRYPTION_DB_VERSION=latest
ARG TFHE_CLI_VERSION=latest
ARG EVMOS_NODE_VERSION=latest
FROM ghcr.io/zama-ai/fhevm-decryptions-db:${DECRYPTION_DB_VERSION} as oracle-env
FROM ghcr.io/zama-ai/fhevm-tfhe-cli:${TFHE_CLI_VERSION} as tfhe-cli
FROM ghcr.io/zama-ai/evmos-node:${EVMOS_NODE_VERSION}

WORKDIR /config

Expand Down
5 changes: 3 additions & 2 deletions docker/Dockerfile.evmos-node.local
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM ghcr.io/zama-ai/zama-zbc-build:v0.1.3 AS build-env
ARG ZBC_VERSION=latest
FROM ghcr.io/zama-ai/zama-zbc-build:${ZBC_VERSION} AS build-env

ENV LD_LIBRARY_PATH=/usr/lib/tfhe
ADD . /src/evmos
Expand All @@ -16,7 +17,7 @@ RUN ls /src/evmos
RUN ls /src/evmos/build
RUN mkdir -p /src/evmos/build

FROM ghcr.io/zama-ai/zama-zbc-build:v0.1.3
FROM ghcr.io/zama-ai/zama-zbc-build:${ZBC_VERSION}

RUN apt-get update -y
RUN apt-get install ca-certificates jq -y
Expand Down

0 comments on commit c24d44f

Please sign in to comment.