github.com/evdatsion/aphelion-dpos-bft@v0.32.1/.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/setup-go@v2
    18          with:
    19            go-version: "^1.15.4"
    20        - uses: actions/checkout@master
    21        - name: Prepare
    22          id: prep
    23          run: |
    24            DOCKER_IMAGE=tendermint/tendermint
    25            VERSION=noop
    26            if [[ $GITHUB_REF == refs/tags/* ]]; then
    27              VERSION=${GITHUB_REF#refs/tags/}
    28            elif [[ $GITHUB_REF == refs/heads/* ]]; then
    29              VERSION=$(echo ${GITHUB_REF#refs/heads/} | sed -r 's#/+#-#g')
    30              if [ "${{ github.event.repository.default_branch }}" = "$VERSION" ]; then
    31                VERSION=latest
    32              fi
    33            fi
    34            TAGS="${DOCKER_IMAGE}:${VERSION}"
    35            if [[ $VERSION =~ ^v[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
    36              TAGS="$TAGS,${DOCKER_IMAGE}:${VERSION}"
    37            fi
    38            echo ::set-output name=tags::${TAGS}
    39  
    40        - name: Set up Docker Buildx
    41          uses: docker/setup-buildx-action@v1
    42  
    43        - name: Login to DockerHub
    44          uses: docker/login-action@v1
    45          with:
    46            username: ${{ secrets.DOCKERHUB_USERNAME }}
    47            password: ${{ secrets.DOCKERHUB_TOKEN }}
    48  
    49        - name: Build Tendermint
    50          run: |
    51            make build-linux && cp build/tendermint DOCKER/tendermint
    52  
    53        - name: Publish to Docker Hub
    54          uses: docker/build-push-action@v2
    55          with:
    56            context: ./DOCKER
    57            file: ./DOCKER/Dockerfile
    58            push: ${{ github.event_name != 'pull_request' }}
    59            tags: ${{ steps.prep.outputs.tags }}