mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-04-10 04:30:38 -07:00
This time I think I understood. We publish in the github.repository_owner's namespace. In my case it's laurent-indermuehle and in case of upstream it's ansible-collection. A proof of that: https://github.com/orgs/ansible-collections/packages <- here there is one attempt I did in february to push my branch to the upstream. So, our tests containers will be visible to the whole community, not just community.mysql.
67 lines
1.8 KiB
YAML
67 lines
1.8 KiB
YAML
---
|
|
name: Build Docker Image for ansible-test
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
registry:
|
|
required: true
|
|
type: string
|
|
image_name:
|
|
required: true
|
|
type: string
|
|
context:
|
|
required: true
|
|
type: string
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
|
|
steps:
|
|
# Requirement to use 'context' in docker/build-push-action@v3
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v3
|
|
|
|
# https://github.com/docker/login-action
|
|
- name: Log into registry ${{ inputs.registry }}
|
|
uses: docker/login-action@v2
|
|
with:
|
|
registry: ${{ inputs.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:
|
|
"${{ inputs.registry }}\
|
|
/${{ github.repository }}\
|
|
/${{ inputs.image_name }}"
|
|
tags: latest
|
|
|
|
# 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
|
|
|
|
# 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: ${{ inputs.context }}
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|