Skip to content

node: cleanup chain genesis #53

node: cleanup chain genesis

node: cleanup chain genesis #53

name: Build Docker timechain node image
on:
push:
branches:
- "ci/binary/**"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
DOCKER_REPO: analoglabs/timenode
jobs:
set-tags:
name: Get & set tags
runs-on: ubuntu-latest
outputs:
commit_hash: ${{ steps.get-sha.outputs.sha }}
commit_hash8: ${{ steps.get-sha.outputs.sha8 }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get SHA
id: get-sha
run: |
sha=$(git log -1 --format='%H')
echo "sha=$sha" >> $GITHUB_OUTPUT
echo "sha8=$(git log -1 --format='%H' | cut -c1-8)" >> $GITHUB_OUTPUT
echo "SHA commit:" $sha
build-binary:
name: Build Docker image
needs: ["set-tags"]
runs-on: ["self-hosted", "container"]
strategy:
fail-fast: false
matrix:
include:
- image: prod
profile: mainnet
features: default
- image: test
profile: testnet
features: default
- image: dev
profile: testnet
features: develop
steps:
- name: Fetch latest code
uses: actions/checkout@v4
- name: Create target dir
run: mkdir -p ${{ github.workspace }}/target/${{ matrix.profile }}
- name: Cache Rust deps
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/target/${{matrix.profile}}
key: docker-timechain-${{ matrix.profile }}-${{ hashFiles('Cargo.lock', 'config/docker/Dockerfile.timenode-release') }}
- name: Build OCI Image
uses: ./.github/actions/buildah-action
with:
image_name: ${{ env.DOCKER_REPO }}-${{ matrix.image }}:${{ needs.set-tags.outputs.commit_hash8 }}
containerfile: ./config/docker/Dockerfile.timenode-release
context: .
volume: ${{ github.workspace }}/target/${{ matrix.profile }}:/build/target/${{ matrix.profile }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
registry: docker.io
push: 'true'
build_args: |
PROFILE=${{ matrix.profile }}
VCS_REF=${{ needs.set-tags.outputs.commit_hash8 }}
BUILD_VARIANT=${{ matrix.image }}
FEATURES=${{ matrix.features }}