name: Update Docker Hub README

on:
  workflow_dispatch:
  push:
    branches:
      - main
    paths:
      - README.md

jobs:
  update_container_readme:
    runs-on: ubuntu-24.04
    name: Push README to Docker Hub
    steps:
      - name: git checkout
        uses: actions/checkout@v4
        with:
          ref: main

      - name: push README to Dockerhub
        uses: peter-evans/dockerhub-description@v4
        with:
          username: ${{ secrets.DOCKER_HUB_README_USERNAME }}
          password: ${{ secrets.DOCKER_HUB_README_PASSWORD }}
          repository: serversideup/php
          short-description: 'Production-ready PHP Docker images optimized for Laravel and WordPress.'
          readme-filepath: 'README.md'