name: Sync Readme to Docker Hub

on:
  push:
    branches:
      - main
    paths:
      - readme.md
      - .github/workflows/sync-dockerhub-readme.yml

jobs:
  sync-dockerhub-readme:
    name: Sync Readme to Docker Hub
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v2

      - name: Sync Readme to Docker Hub
        uses: peter-evans/dockerhub-description@v2
        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_PASSWORD }}
          readme-filepath: ./readme.md
