name: Build & push rundeck image
on:
  pull_request:
  push:
    paths:
      - '.github/workflows/rundeck.yaml'
      - 'oci/rundeck/Dockerfile'
    branches:
      - main

jobs:
  base-image:
    runs-on: ubuntu-latest
    name: Build rundeck base image
    steps:
      - uses: actions/checkout@master

      - name: 'Artifact: build && push rundeck image'
        uses: aevea/action-kaniko@master
        with:
          registry: artifact.onwalk.net
          username: admin 
          password: ${{ secrets.HELM_REPO_PASSWORD }}
          path: 'oci/rundeck/'
          build_file: 'Dockerfile'
          image: k8s/rundeck
          tag: 4.6
          cache: true
          cache_registry: cache
