Skip to content

Commit

Permalink
ci: Add the ability to build & push iroha from specific commit sha (#…
Browse files Browse the repository at this point in the history
…5055)

Signed-off-by: BAStos525 <[email protected]>
  • Loading branch information
BAStos525 authored Sep 12, 2024
1 parent 7b84762 commit 50eb315
Showing 1 changed file with 51 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: I2::Profiling::Publish
name: I2::Custom::Publish

on:
push:
Expand All @@ -14,6 +14,14 @@ on:
options:
- true
- false
BUILD_ALPINE_IMAGE:
description: "Select \"true\" to build and push the alpine image from specific commit SHA"
type: choice
required: true
default: 'false'
options:
- true
- false
CHECKOUT_REF:
description: "The branch, tag or SHA to checkout"
required: true
Expand All @@ -39,6 +47,8 @@ jobs:
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.CHECKOUT_REF }}
- uses: Swatinem/rust-cache@v2
- name: Build iroha executor
run: cargo run --bin iroha_wasm_builder -- build ./wasm_samples/default_executor --optimize --out-file ${{ env.DOCKER_COMPOSE_PATH }}/executor.wasm
Expand All @@ -50,7 +60,7 @@ jobs:
retention-days: 1

registry-profiling-image:
if: ${{ inputs.BUILD_GLIBC_IMAGE == 'false' }}
if: ${{ inputs.BUILD_GLIBC_IMAGE == 'false' }} and ${{ inputs.BUILD_ALPINE_IMAGE == 'false' }}
runs-on: [self-hosted, Linux, iroha2]
needs: build_executor
container:
Expand Down Expand Up @@ -102,7 +112,7 @@ jobs:
context: .

registry-glibc-image:
if: ${{ inputs.BUILD_GLIBC_IMAGE == 'true' }}
if: ${{ inputs.BUILD_GLIBC_IMAGE == 'true' }} and ${{ inputs.BUILD_ALPINE_IMAGE == 'false' }}
runs-on: [self-hosted, Linux, iroha2]
needs: build_executor
container:
Expand All @@ -128,7 +138,7 @@ jobs:
uses: docker/setup-buildx-action@v3
with:
install: true
- name: Build and push iroha2-profiling image
- name: Build and push iroha2-glibc image
uses: docker/build-push-action@v6
if: always()
with:
Expand All @@ -137,3 +147,40 @@ jobs:
labels: commit=${{ github.sha }}
file: ${{env.IROHA2_DOCKERFILE }}
context: .

registry-alpine-image:
if: ${{ inputs.BUILD_GLIBC_IMAGE == 'false' }} and ${{ inputs.BUILD_ALPINE_IMAGE == 'true' }}
runs-on: [self-hosted, Linux, iroha2]
needs: build_executor
container:
image: hyperledger/iroha2-ci:nightly-2024-09-09
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.CHECKOUT_REF }}
- name: Download executor.wasm file
uses: actions/download-artifact@v4
with:
name: executor.wasm
path: ${{ env.DOCKER_COMPOSE_PATH }}
- name: Login to Soramitsu Harbor
uses: docker/login-action@v3
with:
registry: docker.soramitsu.co.jp
username: ${{ secrets.HARBOR_USERNAME }}
password: ${{ secrets.HARBOR_TOKEN }}
- name: Set up Docker Buildx
id: buildx
if: always()
uses: docker/setup-buildx-action@v3
with:
install: true
- name: Build and push iroha2-alpine-sha image
uses: docker/build-push-action@v6
if: always()
with:
push: true
tags: docker.soramitsu.co.jp/iroha2/iroha:${{ github.sha }}
labels: commit=${{ github.sha }}
file: Dockerfile
context: .

0 comments on commit 50eb315

Please sign in to comment.