Skip to content

Commit 991e77a

Browse files
committed
updated workflow for dockerhub desc
1 parent 12afc9b commit 991e77a

File tree

2 files changed

+55
-3
lines changed

2 files changed

+55
-3
lines changed

.github/workflows/docker-publish.yml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ on:
77
- master
88
tags:
99
- 'v*.*.*'
10+
paths-ignore:
11+
- '**.md'
12+
- 'docs/**'
13+
- '.github/**'
14+
- '!.github/workflows/docker-publish.yml'
1015
pull_request:
1116
branches:
1217
- main
@@ -17,6 +22,11 @@ on:
1722
description: 'Docker image tag'
1823
required: false
1924
default: 'latest'
25+
update_readme:
26+
description: 'Update Docker Hub README'
27+
required: false
28+
type: boolean
29+
default: true
2030

2131
env:
2232
DOCKERHUB_IMAGE: ${{ secrets.DOCKERHUB_USERNAME }}/snapdocs
@@ -68,12 +78,23 @@ jobs:
6878
cache-from: type=gha
6979
cache-to: type=gha,mode=max
7080

81+
update-docker-hub-description:
82+
name: Update Docker Hub Description
83+
runs-on: ubuntu-latest
84+
needs: build-and-push
85+
if: |
86+
github.event_name != 'pull_request' &&
87+
(github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.event.inputs.update_readme == 'true')
88+
89+
steps:
90+
- name: Checkout repository
91+
uses: actions/checkout@v4
92+
7193
- name: Update Docker Hub Description
72-
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
7394
uses: peter-evans/dockerhub-description@v4
7495
with:
7596
username: ${{ secrets.DOCKERHUB_USERNAME }}
7697
password: ${{ secrets.DOCKERHUB_TOKEN }}
77-
repository: ${{ secrets.DOCKERHUB_USERNAME }}/snapdocs
98+
repository: ${{ env.DOCKERHUB_IMAGE }}
7899
readme-filepath: ./README.md
79-
short-description: 'SnapDocs - Open source collaborative document workspace'
100+
short-description: 'SnapDocs - Open source, self-hostable document workspace with real-time collaboration'
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Update Docker Hub README
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
paths:
9+
- 'README.md'
10+
workflow_dispatch:
11+
12+
env:
13+
DOCKERHUB_IMAGE: ${{ secrets.DOCKERHUB_USERNAME }}/snapdocs
14+
15+
jobs:
16+
update-readme:
17+
name: Update Docker Hub README
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
24+
- name: Update Docker Hub Description
25+
uses: peter-evans/dockerhub-description@v4
26+
with:
27+
username: ${{ secrets.DOCKERHUB_USERNAME }}
28+
password: ${{ secrets.DOCKERHUB_TOKEN }}
29+
repository: ${{ env.DOCKERHUB_IMAGE }}
30+
readme-filepath: ./README.md
31+
short-description: 'SnapDocs - Open source, self-hostable document workspace with real-time collaboration'

0 commit comments

Comments
 (0)