Skip to content

Commit

Permalink
chore: test github docker builder
Browse files Browse the repository at this point in the history
  • Loading branch information
ggera committed Dec 4, 2024
1 parent fe579d6 commit f615e3b
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 9 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/publish-kilt-node.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build and Push Docker Image

on:
push:
branches:
- docker-image

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v4

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}

- name: Build and Push Docker Image
uses: docker/build-push-action@v6
with:
build-args: NODE_TYPE=standalone-node
context: .
file: Dockerfile
platforms: linux/amd64
tags: |
kiltprotocol/kilt-node:latest-develop
kiltprotocol/kilt-node:${{ github.sha }}
16 changes: 8 additions & 8 deletions .maintain/build-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ target_tag=$1
# Build the builder image and push it in the background
docker build \
--target builder \
--cache-from $AWS_REGISTRY/kilt-parachain/collator:builder \
-t $AWS_REGISTRY/kilt-parachain/collator:builder \
--cache-from $AWS_REGISTRY/kilt-node:builder \
-t $AWS_REGISTRY/kilt-node:builder \
. &
docker push $AWS_REGISTRY/kilt-parachain/collator:builder &
docker push $AWS_REGISTRY/kilt-node:builder &

wait

Expand All @@ -21,19 +21,19 @@ build_and_tag() {
local cache_image=$3

docker build \
--cache-from $AWS_REGISTRY/kilt-parachain/collator:builder \
--cache-from $AWS_REGISTRY/kilt-node:builder \
--cache-from $AWS_REGISTRY/$cache_image:$target_tag \
--build-arg NODE_TYPE=$node_type \
-t local/$image_name:$target_tag \
.
}

build_and_tag "kilt-parachain" "kilt-node" "kilt-parachain/collator" &
build_and_tag "kilt-parachain" "kilt-node" "kilt-node" &

build_and_tag "standalone-node" "standalone-node" "kilt/prototype-chain" &
build_and_tag "standalone-node" "standalone-node" "standalone-node" &

build_and_tag "dip-provider-node-template" "dip-provider-node-template" "kilt-parachain/collator" &
build_and_tag "dip-provider-node-template" "dip-provider-node-template" "kilt-node" &

build_and_tag "dip-consumer-node-template" "dip-consumer-node-template" "kilt-parachain/collator" &
build_and_tag "dip-consumer-node-template" "dip-consumer-node-template" "kilt-node" &

wait
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ RUN cargo build --locked --release --features $FEATURES

# ===== SECOND STAGE ======

FROM docker.io/library/ubuntu:20.04
FROM docker.io/library/ubuntu:22.04
LABEL description="This is the 2nd stage: a very small image where we copy the kilt-parachain binary."

ARG NODE_TYPE=kilt-parachain
Expand Down

0 comments on commit f615e3b

Please sign in to comment.