github.com/cosmos/cosmos-sdk@v0.50.10/.github/workflows/proto-docker.yml (about)

     1  name: Build & Push SDK Proto Builder
     2  on:
     3    push:
     4      branches:
     5        - main
     6      paths:
     7        - "contrib/devtools/Dockerfile"
     8    workflow_dispatch:
     9      inputs:
    10        tags:
    11          description: "Docker image tags"
    12          required: true
    13          type: string
    14    pull_request:
    15      paths:
    16        - "contrib/devtools/Dockerfile"
    17  
    18  env:
    19    REGISTRY: ghcr.io
    20    IMAGE_NAME: cosmos/proto-builder
    21  
    22  # Allow one concurrent deployment
    23  concurrency:
    24    group: "proto-docker"
    25    cancel-in-progress: true
    26  
    27  jobs:
    28    build:
    29      runs-on: ubuntu-latest
    30      permissions:
    31        contents: read
    32        packages: write
    33      steps:
    34        # set VERSION to new version when making changes, when merged to main the image will automatically be pushed
    35        - uses: actions/checkout@v3
    36  
    37        - name: Set up QEMU
    38          uses: docker/setup-qemu-action@v2
    39  
    40        - name: Set up Docker Buildx
    41          uses: docker/setup-buildx-action@v2
    42  
    43        - name: Extract metadata (tags, labels) for Docker
    44          id: meta
    45          uses: docker/metadata-action@57396166ad8aefe6098280995947635806a0e6ea
    46          with:
    47            images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
    48            # modify value when deploying a new version
    49            tags: |
    50              type=semver,pattern={{version}},value=${{ inputs.tags }}
    51  
    52        - name: Login to GitHub Container Registry
    53          uses: docker/login-action@v2
    54          if: ${{ github.event_name != 'pull_request' }}
    55          with:
    56            registry: ${{ env.REGISTRY }}
    57            username: ${{ github.actor }}
    58            password: ${{ secrets.GITHUB_TOKEN }}
    59  
    60        - name: Publish to GHCR
    61          uses: docker/build-push-action@v4
    62          with:
    63            context: ./contrib/devtools
    64            platforms: linux/amd64,linux/arm64
    65            push: ${{ github.event_name != 'pull_request' }}
    66            tags: ${{ steps.meta.outputs.tags }}
    67            labels: ${{ steps.meta.outputs.labels }}