Skip to content

[release-20.0] Release of v20.0.5 (#17591) #925

[release-20.0] Release of v20.0.5 (#17591)

[release-20.0] Release of v20.0.5 (#17591) #925

name: Docker Build vttestserver
on:
push:
branches:
- main
tags:
- '*'
concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Docker Build vttestserver')
cancel-in-progress: true
permissions: read-all
jobs:
build_and_push:
name: Build and push vitess/vttestserver Docker images
runs-on: gh-hosted-runners-16cores-1
if: github.repository == 'vitessio/vitess'
strategy:
fail-fast: true
matrix:
branch: [ mysql80 ]
steps:
- name: Check out code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: 'false'
- name: Login to Docker Hub
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set Dockerfile path
run: |
echo "DOCKERFILE=./docker/vttestserver/Dockerfile.${{ matrix.branch }}" >> $GITHUB_ENV
- name: Build and push on main
if: github.ref == 'refs/heads/main'
uses: docker/build-push-action@b32b51a8eda65d6793cd0494a773d4f6bcef32dc # v6.11.0
with:
context: .
file: ${{ env.DOCKERFILE }}
push: true
tags: vitess/vttestserver:${{ matrix.branch }}
- name: Get the Git tag
if: startsWith(github.ref, 'refs/tags/')
run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Set Docker tag name
if: startsWith(github.ref, 'refs/tags/')
run: |
echo "DOCKER_TAG=vitess/vttestserver:${TAG_NAME}-${{ matrix.branch }}" >> $GITHUB_ENV
- name: Build and push on tags
if: startsWith(github.ref, 'refs/tags/')
uses: docker/build-push-action@b32b51a8eda65d6793cd0494a773d4f6bcef32dc # v6.11.0
with:
context: .
file: ${{ env.DOCKERFILE }}
push: true
tags: ${{ env.DOCKER_TAG }}