name: build & push ci runer images

on:
  push:
    branches:
      - main
    paths:
      - '.github/workflows/build-ci-images.yml'
      - 'oci/base/alpine-image-builder/Dockerfile' 
  pull_request:
    branches:
      - main
    paths:
      - '.github/workflows/build-ci-images.yml'
      - 'oci/base/alpine-image-builder/Dockerfile' 
  workflow_dispatch:
    branches:
      - main
env:
  IMAGE_REPO: "artifact.onwalk.net"

jobs:
  build-ansible-lint-image:
    name: Build ansible lint image
    uses: svc-design/actions/.github/workflows/build-images.yaml@main
    with:
      method: 'docker/node'
      registry_addr: "harbor.onwalk.net"
      dockerfile_path: 'oci/base/alpine-ansible-lint'
      image_name: 'public/base/alpine-ansible-lint'
      image_tag: 'latest'
    secrets:
      artifactory_sa: ${{ secrets.REPO_USER }}
      artifactory_pw: ${{ secrets.HELM_REPO_PASSWORD }}

  build-alpine-glibc-image:
    name: Build alpine glibc image
    uses: svc-design/actions/.github/workflows/build-images.yaml@main
    with:
      method: 'docker/node'
      registry_addr: "artifact.onwalk.net"
      dockerfile_path: 'oci/base/alpine-glibc'
      image_name: 'public/base/alpine-glibc'
      image_tag: 'latest'
    secrets:
      artifactory_sa: ${{ secrets.REPO_USER }}
      artifactory_pw: ${{ secrets.HELM_REPO_PASSWORD }}

  build-go-lint-image:
    name: Build go lint image
    uses: svc-design/actions/.github/workflows/build-images.yaml@main
    with:
      method: 'docker/node'
      registry_addr: "artifact.onwalk.net"
      image_name: 'public/base/alpine-go-lint'
      image_tag: 'latest'
      dockerfile_path: 'oci/base/alpine-go-lint'
    secrets:
      artifactory_sa: ${{ secrets.REPO_USER }}
      artifactory_pw: ${{ secrets.HELM_REPO_PASSWORD }}

  build-python-lint-image:
    name: Build python lint image
    uses: svc-design/actions/.github/workflows/build-images.yaml@main
    with:
      method: 'docker/node'
      registry_addr: "artifact.onwalk.net"
      image_name: 'public/base/alpine-python-lint'
      image_tag: 'latest'
      dockerfile_path: 'oci/base/alpine-python-lint'
    secrets:
      artifactory_sa: ${{ secrets.REPO_USER }}
      artifactory_pw: ${{ secrets.HELM_REPO_PASSWORD }}

  build-yaml-lint-image:
    name: Build yaml lint image
    uses: svc-design/actions/.github/workflows/build-images.yaml@main
    with:
      method: 'docker/node'
      registry_addr: "artifact.onwalk.net"
      image_name: 'public/base/alpine-yaml-lint'
      image_tag: 'latest'
      dockerfile_path: 'oci/base/alpine-yaml-lint'
    secrets:
      artifactory_sa: ${{ secrets.REPO_USER }}
      artifactory_pw: ${{ secrets.HELM_REPO_PASSWORD }}

  build-eslint-image:
    name: Build es lint image
    uses: svc-design/actions/.github/workflows/build-images.yaml@main
    with:
      method: 'docker/node'
      registry_addr: "artifact.onwalk.net"
      image_name: 'public/base/alpine-eslint'
      image_tag: 'latest'
      dockerfile_path: 'oci/base/alpine-eslint'
    secrets:
      artifactory_sa: ${{ secrets.REPO_USER }}
      artifactory_pw: ${{ secrets.HELM_REPO_PASSWORD }}

  build-chart-builder:
    name: Build chart builder image
    uses: svc-design/actions/.github/workflows/build-images.yaml@main
    with:
      method: 'docker/node'
      registry_addr: "artifact.onwalk.net"
      image_name: 'public/base/alpine-chart-builder'
      image_tag: 'latest'
      dockerfile_path: 'oci/base/alpine-chart-builder'
    secrets:
      artifactory_sa: ${{ secrets.REPO_USER }}
      artifactory_pw: ${{ secrets.HELM_REPO_PASSWORD }}

  build-image-builder:
    name: Build image builder image
    uses: svc-design/actions/.github/workflows/build-images.yaml@main
    with:
      method: 'docker/node'
      registry_addr: "artifact.onwalk.net"
      image_name: 'public/base/alpine-image-builder'
      image_tag: 'latest'
      dockerfile_path: 'oci/base/alpine-image-builder'
    secrets:
      artifactory_sa: ${{ secrets.REPO_USER }}
      artifactory_pw: ${{ secrets.HELM_REPO_PASSWORD }}
  build-debian-jenkins-agent:
    name: Build debian-jenkins-agent image
    uses: svc-design/actions/.github/workflows/build-images.yaml@main
    with:
      method: 'docker/node'
      registry_addr: "artifact.onwalk.net"
      image_name: 'public/base/debian-jenkins-agent'
      image_tag: 'latest'
      dockerfile_path: 'oci/base/debian-jenkins-agent'
    secrets:
      artifactory_sa: ${{ secrets.REPO_USER }}
      artifactory_pw: ${{ secrets.HELM_REPO_PASSWORD }}
