From 1585873ed069943088583d50fb22173b0366c46f Mon Sep 17 00:00:00 2001 From: Pau RE Date: Wed, 27 Dec 2023 17:13:07 +0100 Subject: [PATCH] Add automatic update container description action --- .github/workflows/ci.yml | 3 +++ .github/workflows/readme.yml | 31 +++++++++++++++++++++++++++++++ .gitignore | 3 ++- dockerhub-header.md | 6 ++++++ 4 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/readme.yml create mode 100644 dockerhub-header.md diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 16e9e3b..e7d6a66 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,9 +6,12 @@ on: - 'main' paths-ignore: - '**.md' + - '.gitignore' + - '.github/workflows/readme.yml' pull_request: paths-ignore: - '**.md' + - '.github/**' jobs: test-script: diff --git a/.github/workflows/readme.yml b/.github/workflows/readme.yml new file mode 100644 index 0000000..cc1ae28 --- /dev/null +++ b/.github/workflows/readme.yml @@ -0,0 +1,31 @@ +name: README + +on: + push: + branches: + - 'main' + paths: + - 'README.md' + - 'dockerhub-header.md' + - '.github/workflows/readme.yml' + +jobs: + push-readme: + runs-on: ubuntu-22.04 + environment: docker.io + steps: + - uses: actions/checkout@v3 + + - name: Generate README for DockerHub + run: cp dockerhub-header.md dockerhub.md && awk '{if(p)print}/^# /{p=1}' README.md >> dockerhub.md + + - name: Push README to DockerHub + uses: christian-korneck/update-container-description-action@v1 + env: + DOCKER_USER: ${{ secrets.DOCKERHUB_USERNAME }} + DOCKER_PASS: ${{ secrets.DOCKERHUB_TOKEN }} + with: + destination_container_repo: ${{ secrets.DOCKERHUB_USERNAME }}/postgres-backup-local + provider: dockerhub + short_description: 'Backup PostgresSQL to local filesystem with periodic backups and rotate backups.' + readme_file: 'dockerhub.md' \ No newline at end of file diff --git a/.gitignore b/.gitignore index c8691c4..8081078 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -.data \ No newline at end of file +.data +dockerhub.md \ No newline at end of file diff --git a/dockerhub-header.md b/dockerhub-header.md new file mode 100644 index 0000000..9171731 --- /dev/null +++ b/dockerhub-header.md @@ -0,0 +1,6 @@ +[![GitHub code](https://img.shields.io/static/v1?label=Source%20code&message=%20&style=social&logo=github)](https://github.com/prodrigestivill/docker-postgres-backup-local) +![GitHub stars](https://img.shields.io/github/stars/prodrigestivill/docker-postgres-backup-local?style=social) +![GitHub issues](https://img.shields.io/github/issues-raw/prodrigestivill/docker-postgres-backup-local?logo=github&style=social) +[![GitHub actions](https://github.com/prodrigestivill/docker-postgres-backup-local/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/prodrigestivill/docker-postgres-backup-local/actions) + +# prodrigestivill/postgres-backup-local