github.com/Team-Kujira/tendermint@v0.34.24-indexer/.github/workflows/docker.yml (about)

     1  name: Build & Push
     2  #  Build & Push rebuilds the tendermint docker image on every push to master and creation of tags
     3  # and pushes the image to https://hub.docker.com/r/interchainio/simapp/tags
     4  on:
     5    pull_request:
     6    push:
     7      branches:
     8        - master
     9      tags:
    10        - "v[0-9]+.[0-9]+.[0-9]+" # Push events to matching v*, i.e. v1.0, v20.15.10
    11        - "v[0-9]+.[0-9]+.[0-9]+-rc*" # Push events to matching v*, i.e. v1.0-rc1, v20.15.10-rc5
    12  
    13  jobs:
    14    build:
    15      runs-on: ubuntu-latest
    16      steps:
    17        - uses: actions/checkout@v3
    18        - name: Prepare
    19          id: prep
    20          run: |
    21            DOCKER_IMAGE=tendermint/tendermint
    22            VERSION=noop
    23            if [[ $GITHUB_REF == refs/tags/* ]]; then
    24              VERSION=${GITHUB_REF#refs/tags/}
    25            elif [[ $GITHUB_REF == refs/heads/* ]]; then
    26              VERSION=$(echo ${GITHUB_REF#refs/heads/} | sed -r 's#/+#-#g')
    27              if [ "${{ github.event.repository.default_branch }}" = "$VERSION" ]; then
    28                VERSION=latest
    29              fi
    30            fi
    31            TAGS="${DOCKER_IMAGE}:${VERSION}"
    32            if [[ $VERSION =~ ^v[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
    33              TAGS="$TAGS,${DOCKER_IMAGE}:${VERSION}"
    34            fi
    35            echo ::set-output name=tags::${TAGS}
    36  
    37        - name: Set up QEMU
    38          uses: docker/setup-qemu-action@master
    39          with:
    40            platforms: all
    41  
    42        - name: Set up Docker Buildx
    43          uses: docker/setup-buildx-action@v2
    44  
    45        - name: Login to DockerHub
    46          if: ${{ github.event_name != 'pull_request' }}
    47          uses: docker/login-action@v2
    48          with:
    49            username: ${{ secrets.DOCKERHUB_USERNAME }}
    50            password: ${{ secrets.DOCKERHUB_TOKEN }}
    51  
    52        - name: Publish to Docker Hub
    53          uses: docker/build-push-action@v3
    54          with:
    55            context: .
    56            file: ./DOCKER/Dockerfile
    57            platforms: linux/amd64,linux/arm64
    58            push: ${{ github.event_name != 'pull_request' }}
    59            tags: ${{ steps.prep.outputs.tags }}