name: publish-petclinic-base-image
on:
  push:
    paths:
      - 'benchmark-overhead/Dockerfile-petclinic-base'
    branches: [ 'main' ]
  workflow_dispatch:
jobs:
  push_to_registry:
    name: make spring-petclinic-rest base image for overhead testing
    runs-on: ubuntu-latest
    permissions:
      packages: write
      contents: read
    steps:
      - name: check out the repo
        uses: actions/checkout@v3
      - uses: docker/setup-buildx-action@v1
      - name: Login to GitHub Container Registry
        uses: docker/login-action@v1
        with:
          registry: ghcr.io
          username: ${{ github.repository_owner }}
          password: ${{ secrets.GITHUB_TOKEN }}
      - name: push to gh packages
        uses: docker/build-push-action@v2
        with:
          push: true
          file: benchmark-overhead/Dockerfile-petclinic-base
          tags: ghcr.io/open-telemetry/opentelemetry-java-instrumentation/petclinic-rest-base:latest
