Skip to content

Unify protoc dependencies between services #7

Unify protoc dependencies between services

Unify protoc dependencies between services #7

Workflow file for this run

on:
push:
branches:
- 'main'
paths:
- .github/workflows/base-image.yml
- docker/base.Dockerfile
pull_request:
paths:
- .github/workflows/base-image.yml
- docker/base.Dockerfile
env:
REGISTRY: ghcr.io
IMAGE_NAME: blockscout/eth-bytecode-db
jobs:
build_and_push:
name: Build and push
runs-on: ubuntu-latest
steps:
# - name: Checkout
# 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: Extract cargo chef and protoc versions
# id: extract-versions
# env:
# DOCKERFILE_PATH: "docker/base.Dockerfile"
# run: |
# CONTENT=$(cat $DOCKERFILE_PATH)
#
# nl=$'\n'
#
# if [[ $CONTENT =~ ARG\ CARGO_CHEF_VERSION=([^$nl]+) ]]; then
# CARGO_CHEF_TAG=${BASH_REMATCH[1]}
# else
# echo "Failed to extract CARGO_CHEF_TAG from Dockerfile"
# exit 1
# fi
#
# if [[ $CONTENT =~ ARG\ PROTOC_VERSION=([^$nl]+) ]]; then
# PROTOC_VERSION=${BASH_REMATCH[1]}
# else
# echo "Failed to extract PROTOC_VERSION from Dockerfile"
# exit 1
# fi
#
# if [[ $CONTENT =~ ARG\ PROTOC_GEN_OPENAPIV2_VERSION=([^$nl]+) ]]; then
# PROTOC_GEN_OPENAPIV2_VERSION=${BASH_REMATCH[1]}
# else
# echo "Failed to extract PROTOC_GEN_OPENAPIV2_VERSION from Dockerfile"
# exit 1
# fi
#
# echo "CARGO_CHEF_TAG=$CARGO_CHEF_TAG"
# echo "PROTOC_VERSION=$PROTOC_VERSION"
# echo "PROTOC_GEN_OPENAPIV2_VERSION=$PROTOC_GEN_OPENAPIV2_VERSION"
#
# # Save values to be available from the next steps
# echo "cargo_chef_tag=$CARGO_CHEF_TAG" >> $GITHUB_OUTPUT
# echo "protoc_version=$PROTOC_VERSION" >> $GITHUB_OUTPUT
# echo "protoc_gen_openapiv2_version=$PROTOC_GEN_OPENAPIV2_VERSION" >> $GITHUB_OUTPUT
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Check image tag exists
run: |
TOKEN=$(echo ${{ secrets.GITHUB_TOKEN }} | base64)
curl -H "Authorization: Bearer ${TOKEN}" https://ghcr.io/v2/blockscout/visualizer/tags/list
curl --head --fail -H "Authorization: Bearer ${TOKEN}" https://ghcr.io/v2/blockscout/visualizer/manifests/latest
# - name: Extract metadata for Docker
# id: meta
# uses: docker/metadata-action@v5
# with:
# images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
#
# - name: Print docker tags
# run: |
# echo "tags=${{ steps.meta.outputs.tags }}"
# echo "labels=${{ steps.meta.outputs.labels }}"
#