Docker Image MySQL #733
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker Image MySQL | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 6 * * *" # 6 AM Daily | |
push: | |
paths: | |
- mysql/** | |
- .github/workflows/mysql.yml | |
jobs: | |
mysql: | |
name: MySQL | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
version: | |
- "8.0.28" | |
- "8.0" | |
- "8.1" | |
- "8.2" | |
- "8.3" | |
- "8.4" | |
- "9.0" | |
- "9.1" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: docker/setup-qemu-action@v3 | |
- uses: docker/setup-buildx-action@v3 | |
- name: Login to Github Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
if: ${{ !env.ACT }} | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
if: ${{ !env.ACT }} | |
- name: Set build-args | |
run: |- | |
ESCAPED_VERSION="$(echo ${{ matrix.version }} | sed 's/\./\\\./g')" | |
MYSQL_VERSION=$( | |
docker run --rm gcr.io/go-containerregistry/crane ls mysql \ | |
| egrep "^${ESCAPED_VERSION}(\.[0-9]+)?(\.[0-9]+)?(-oracle)?\$" | sort -Vr | head -n1 | |
) | |
echo "MYSQL_VERSION=${MYSQL_VERSION}" | tee /dev/stderr >> $GITHUB_ENV | |
- uses: docker/build-push-action@v6 | |
with: | |
context: mysql | |
platforms: linux/amd64,linux/arm64 | |
build-args: MYSQL_VERSION=${{ env.MYSQL_VERSION }} | |
push: ${{ github.ref == 'refs/heads/main' && !env.ACT }} | |
tags: ghcr.io/${{ github.repository_owner }}/mysql:${{ matrix.version }},wardenenv/mysql:${{matrix.version}} | |
mysql-legacy: | |
name: MySQL Legacy | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
version: | |
- "5.5" | |
- "5.6" | |
- "5.7" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: docker/setup-qemu-action@v3 | |
- uses: docker/setup-buildx-action@v3 | |
- name: Login to Github Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
if: ${{ !env.ACT }} | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
if: ${{ !env.ACT }} | |
- name: Set build-args | |
run: |- | |
ESCAPED_VERSION="$(echo ${{ matrix.version }} | sed 's/\./\\\./g')" | |
MYSQL_VERSION=$( | |
docker run --rm gcr.io/go-containerregistry/crane ls mysql \ | |
| egrep "^${ESCAPED_VERSION}(\.[0-9]+)?(\.[0-9]+)?(-oracle)?\$" | sort -Vr | head -n1 | |
) | |
echo "MYSQL_VERSION=${MYSQL_VERSION}" | tee /dev/stderr >> $GITHUB_ENV | |
- uses: docker/build-push-action@v6 | |
with: | |
context: mysql | |
platforms: linux/amd64 | |
build-args: MYSQL_VERSION=${{ env.MYSQL_VERSION }} | |
push: ${{ github.ref == 'refs/heads/main' && !env.ACT }} | |
tags: ghcr.io/${{ github.repository_owner }}/mysql:${{ matrix.version }},wardenenv/mysql:${{matrix.version}} |