Skip to content

improve docker images, improve ci #30

improve docker images, improve ci

improve docker images, improve ci #30

Workflow file for this run

name: Rebuild MASP indexer images (triggerable)
on:
workflow_dispatch:
inputs:
tag:
description: "The container tag"
required: true
type: string
pull_request:
paths:
- 'masp-indexer/**'
push:
branches:
- master
paths:
- 'masp-indexer/**'
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:
masp-indexer:
strategy:
fail-fast: true
matrix:
images:
- name: "masp-indexer-webserver"
context: "masp-indexer/webserver"
sha: "master"
cache_scope: "masp-indexer-webserver-image"
- name: "masp-indexer-chain"
context: "masp-indexer/chain"
sha: "master"
cache_scope: "masp-indexer-chain-image"
- name: "masp-indexer-block-filter"
context: "masp-indexer/block-filter"
sha: "master"
cache_scope: "masp-indexer-block-filter-image"
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: us-central1-docker.pkg.dev/molten-verve-216720/heliax-repository
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 and push
uses: docker/build-push-action@v6
with:
context: ${{ matrix.images.context }}
push: ${{ github.event_name != 'pull_request' }}
tags: |
ghcr.io/heliaxdev/ant-${{ matrix.images.name }}:${{ github.event.inputs.tag || github.sha }}
us-central1-docker.pkg.dev/molten-verve-216720/heliax-repository/${{ matrix.images.name }}:${{ github.event.inputs.tag || github.sha }}
cache-from: type=gha,scope=${{ matrix.images.cache_scope }}
cache-to: type=gha,scope=${{ matrix.images.cache_scope }},mode=max
build-args: |
GIT_SHA=${{ matrix.images.sha || 'master' }}