mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-07-24 13:50:26 -07:00
87 lines
2.7 KiB
YAML
87 lines
2.7 KiB
YAML
---
|
|
name: Docker Image CI
|
|
|
|
on:
|
|
push:
|
|
branch:
|
|
- main
|
|
- lie_tests_using_containers
|
|
paths:
|
|
- 'test-containers/**'
|
|
- '.github/workflows/docker-image.yml'
|
|
|
|
env:
|
|
REGISTRY: ghcr.io
|
|
IMAGE_NAME: ${{ github.actor }}/test-container-
|
|
CONTEXT: test-containers
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- subfolder: mariadb103-py38-mysqlclient201
|
|
- subfolder: mariadb103-py38-pymysql093
|
|
- subfolder: mariadb103-py39-mysqlclient203
|
|
- subfolder: mariadb103-py39-pymysql093
|
|
- subfolder: mariadb106-py310-mysqlclient211
|
|
- subfolder: mariadb106-py310-pymysql102
|
|
- subfolder: my57-py38-mysqlclient201
|
|
- subfolder: my57-py38-pymysql0711
|
|
- subfolder: my57-py38-pymysql093
|
|
- subfolder: my80-py310-mysqlclient211
|
|
- subfolder: my80-py310-pymysql102
|
|
- subfolder: my80-py38-mysqlclient201
|
|
- subfolder: my80-py38-pymysql0711
|
|
- subfolder: my80-py38-pymysql093
|
|
- subfolder: my80-py39-mysqlclient203
|
|
- subfolder: my80-py39-pymysql093
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v3
|
|
|
|
# https://github.com/docker/login-action
|
|
- name: Log into registry ${{ env.REGISTRY }}
|
|
uses: docker/login-action@v2
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
# https://github.com/docker/metadata-action
|
|
- name: Extract Docker metadata (tags, labels)
|
|
id: meta
|
|
uses: docker/metadata-action@v4
|
|
with:
|
|
images:
|
|
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}${{ matrix.subfolder }}
|
|
|
|
# Setting up Docker Buildx with docker-container driver is required
|
|
# at the moment to be able to use a subdirectory with Git context
|
|
#
|
|
# https://github.com/docker/setup-buildx-action
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v2
|
|
with:
|
|
# Use the previous version of buildx https://github.com/docker/buildx/releases
|
|
# to solve https://github.com/docker/build-push-action/issues/761
|
|
version: v0.9.1
|
|
|
|
# https://github.com/docker/build-push-action
|
|
- name: Build and push Docker image with Buildx
|
|
id: build-and-push
|
|
uses: docker/build-push-action@v3
|
|
with:
|
|
context: ${{ env.CONTEXT }}/${{ matrix.subfolder }}
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|