github.com/Finschia/ostracon@v1.1.5/.github/workflows/docker.yml (about) 1 name: Build & Push 2 # Build & Push rebuilds the ostracon docker image on every push to main 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 - main 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-docker: 15 runs-on: ubuntu-latest 16 steps: 17 - uses: actions/checkout@v4 18 - name: Prepare 19 id: prep 20 run: | 21 DOCKER_IMAGE=ostracon/ostracon 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 DEFAULT_BRANCH=$(curl -s -H "Accept: application/vnd.github.v3+json" \ 28 https://api.github.com/repos/Finschia/ostracon | \ 29 grep default_branch | \ 30 cut -d"\"" -f4) 31 if [ "$DEFAULT_BRANCH" = "$VERSION" ]; then 32 VERSION=latest 33 fi 34 fi 35 TAGS="${DOCKER_IMAGE}:${VERSION}" 36 if [[ $VERSION =~ ^v[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then 37 TAGS="$TAGS,${DOCKER_IMAGE}:${VERSION%.*}" 38 fi 39 echo "tags=${TAGS}" >> $GITHUB_OUTPUT 40 41 # - name: Set up QEMU 42 # uses: docker/setup-qemu-action@master 43 # with: 44 # platforms: all 45 46 # - name: Set up Docker Buildx 47 # uses: docker/setup-buildx-action@v1.3.0 48 49 # - name: Login to DockerHub 50 # if: ${{ github.event_name != 'pull_request' }} 51 # uses: docker/login-action@v1 52 # with: 53 # username: ${{ secrets.DOCKERHUB_USERNAME }} 54 # password: ${{ secrets.DOCKERHUB_TOKEN }} 55 56 # - name: Publish to Docker Hub 57 # uses: docker/build-push-action@v2.4.0 58 # with: 59 # context: . 60 # file: ./DOCKER/Dockerfile 61 # platforms: linux/amd64,linux/arm64 62 # push: ${{ github.event_name != 'pull_request' }} 63 # tags: ${{ steps.prep.outputs.tags }}