Skip to content

Test PR

Test PR #381

name: docker-builder
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
on:
workflow_dispatch:
push:
branches:
- develop
- dev-[2-9][0-9].[0-9][0-9].x
paths:
- '.github/docker/**'
pull_request:
paths:
- '.github/docker/**'
jobs:
get-version:
uses: ./.github/workflows/get-version.yml
create-and-push-docker:
needs: [get-version]
runs-on: [self-hosted, collect]
strategy:
fail-fast: false
matrix:
distrib: [alma8, alma9, debian-bullseye]
include:
- project: collect
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Login to Registry
uses: docker/login-action@v2
with:
registry: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}
username: ${{ secrets.DOCKER_REGISTRY_ID }}
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
- name: Login to Proxy Registry
uses: docker/login-action@v2
with:
registry: ${{ vars.DOCKER_PROXY_REGISTRY_URL }}
username: ${{ secrets.DOCKER_REGISTRY_ID }}
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
- name: Set up Docker context for builds
shell: bash
id: buildx-context
run: |
docker context create buildx-context
- uses: docker/setup-buildx-action@v2
with:
endpoint: buildx-context
- uses: docker/build-push-action@v3
with:
file: .github/docker/Dockerfile.${{ matrix.project }}-${{ matrix.distrib }}
context: .
build-args: "REGISTRY_URL=${{ vars.DOCKER_PROXY_REGISTRY_URL }}"
pull: true
push: true
tags: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/centreon-${{ matrix.project }}-${{ matrix.distrib }}:${{ needs.get-version.outputs.img_version }}