name: Barman Base Image
on:
  workflow_dispatch:
  schedule:
    - cron: "0 0 * * 0"
  push:
    branches:
      - main
    paths:
      - 'containers/sidecar-requirements.txt'

permissions: read-all

jobs:
  build:
    runs-on: ubuntu-latest
    permissions:
      packages: write
      contents: write
    steps:
      - name: Checkout
        uses: actions/checkout@v5
      - name: Install QEMU static binaries
        uses: docker/setup-qemu-action@v3
      - name: Install Task
        uses: arduino/setup-task@v2
      - name: Install Dagger
        env:
          # renovate: datasource=github-tags depName=dagger/dagger versioning=semver
          DAGGER_VERSION: 0.19.5
        run: |
          curl -L https://dl.dagger.io/dagger/install.sh | BIN_DIR=$HOME/.local/bin sh
      - name: Publish a barman-base
        env:
          REGISTRY_USER: ${{ github.actor }}
          REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
        run: |
          task publish-barman-base
