centreon-plugins/.github/workflows/docker-builder-packaging-pl...

57 lines
1.6 KiB
YAML

name: docker-builder-packaging-plugins
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
on:
workflow_dispatch:
push:
branches:
- develop
paths:
- ".github/workflows/docker-builder-packaging-plugins.yml"
- ".github/docker/*"
pull_request:
paths:
- ".github/workflows/docker-builder-packaging-plugins.yml"
- ".github/docker/*"
jobs:
create-and-push-docker:
runs-on: ubuntu-22.04
strategy:
matrix:
distrib: [centos7, alma8, alma9, bullseye]
include:
- project: plugins
steps:
- name: Checkout sources
uses: actions/checkout@v3
- 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 }}
- uses: docker/setup-buildx-action@v2
- uses: docker/build-push-action@v3
with:
file: .github/docker/Dockerfile.packaging-${{ matrix.project }}-${{ matrix.distrib }}
context: .
build-args: "REGISTRY_URL=${{ vars.DOCKER_PROXY_REGISTRY_URL }}"
pull: true
push: true
tags: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/packaging-${{ matrix.project }}-${{ matrix.distrib }}:latest