Skip to content

improve docker images, improve ci #34

improve docker images, improve ci

improve docker images, improve ci #34

Workflow file for this run

name: Rebuild Namada images (triggerable)
on:
workflow_dispatch:
inputs:
commit:
description: "The namada SHA commit to build"
required: true
type: string
genesis_template_version:
description: "The genesis template version"
required: true
type: string
schedule:
- cron: "0 20 * * *"
pull_request:
paths:
- 'config/**'
- 'namada/**'
- 'genesis/**'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
packages: write
attestations: write
id-token: write
jobs:
namada:
runs-on: ubuntu-latest
env:
antithesis_registry_url: us-central1-docker.pkg.dev/molten-verve-216720/heliax-repository
strategy:
fail-fast: true
matrix:
images:
- context: "config"
image: "namada-config"
tag: "config-scope"
- context: "genesis"
cache_scope: "genesis-image"
image: "namada-genesis"
tag: ""
- image: "namada"
cache_scope: "namada-image"
tag: ""
context: "namada"
- image: "namada"
tag: -inst
context: "namada"
cache_scope: "namada-inst-image"
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to private registry
uses: docker/login-action@v3
with:
registry: ${{ env.antithesis_registry_url }}
username: _json_key
password: ${{ secrets.ANTITHESIS_GAR_JSON_KEY }}
- name: Login to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build & Push Image ${{ matrix.images.image }} with sha commit ${{ github.event.inputs.commit || 'main' }}/${{ github.event.inputs.genesis_template_version || '0.46.0-ant' }}
uses: docker/build-push-action@v6
with:
context: ${{ matrix.images.context }}
push: ${{ github.event_name != 'pull_request' }}
tags: |
ghcr.io/heliaxdev/ant-${{ matrix.images.image }}:${{ github.event.inputs.tag || github.sha }}${{ matrix.images.tag }}
us-central1-docker.pkg.dev/molten-verve-216720/heliax-repository/${{ matrix.images.image }}:${{ github.event.inputs.tag || github.sha }}${{ matrix.images.tag }}
cache-from: type=gha,scope=${{ matrix.images.cache_scope }}
cache-to: type=gha,scope=${{ matrix.images.cache_scope }},mode=max
build-args: |
GENESIS_TEMPLATE_VERSION=${{ github.event.inputs.genesis_template_version || '0.46.0-ant' }}
GIT_SHA=${{ github.event.inputs.commit || 'main' }}