Skip to content

Fix build pipeline

Fix build pipeline #5

Workflow file for this run

name: Docker - CI
on:
push:
branches: [ 'main' ]
tags-ignore: [ '**' ]
paths: [ 'docker/**', '.github/workflows/docker-ci.yml' ]
permissions:
contents: read
packages: write
jobs:
prepare:
name: Prepare Matrix
runs-on: ubuntu-latest
outputs:
ansible-versions: ${{ steps.set-matrix.outputs.ansible-versions }}
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Set Matrix
id: set-matrix
run: |
matrix=$(cat docker/config.json | jq -c '.ansible.versions')
echo "ansible-versions=$matrix" >> $GITHUB_OUTPUT
registry:
name: Build & Push
runs-on: ubuntu-latest
needs: prepare
strategy:
matrix:
ansible-version: ${{ fromJson(needs.prepare.outputs.ansible-versions) }}
steps:
- name: Check out repository code
uses: actions/checkout@v5
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=raw,value=${{ matrix.ansible-version }}-preview
type=sha,prefix=${{ matrix.ansible-version }}-,suffix=-preview,format=short
- name: Build and Push Docker image
uses: docker/build-push-action@v5
with:
context: ./docker
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
ANSIBLE_VERSION=${{ matrix.ansible-version }}