name: Build & push dotnetcore-app images
on:
  schedule:
    - cron: "0 0 * * *"
  pull_request:
  push:
    paths:
      - 'oci/dotnetcore-app/Dockerfile'
      - '.github/workflows/dotnetcore-app.yaml'
  workflow_dispatch:
    branches:
      - main

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

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