Repository navigation
Expand file tree
/
Copy pathsync_dockerhub_description.yaml
More file actions
57 lines (49 loc) · 1.78 KB
/
Copy pathsync_dockerhub_description.yaml
File metadata and controls
57 lines (49 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Sync Docker Hub description
on:
push:
branches: ["main"]
paths:
- README.md
- README.dockerhub.md
- .github/workflows/sync_dockerhub_description.yaml
workflow_dispatch:
permissions:
contents: read
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Check Docker Hub secrets
id: dockerhub
shell: bash
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
run: |
set -euo pipefail
if [ -n "${DOCKERHUB_USERNAME:-}" ] && [ -n "${DOCKERHUB_TOKEN:-}" ]; then
echo "enabled=true" >> "$GITHUB_OUTPUT"
else
echo "enabled=false" >> "$GITHUB_OUTPUT"
fi
- name: Update Docker Hub description
if: steps.dockerhub.outputs.enabled == 'true'
uses: peter-evans/dockerhub-description@v5
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: smoochy84/caddy-cloudflare-modules
short-description: Custom Caddy images with curated modules and automatic upstream rebuilds
readme-filepath: ./README.dockerhub.md
enable-url-completion: true
- name: Write summary
if: always()
shell: bash
run: |
if [ "${{ steps.dockerhub.outputs.enabled }}" = "true" ]; then
printf 'Docker Hub description sync completed for `smoochy84/caddy-cloudflare-modules`.\n' >> "$GITHUB_STEP_SUMMARY"
else
printf 'Docker Hub description sync skipped. Set `DOCKERHUB_USERNAME` and `DOCKERHUB_TOKEN` repository secrets to enable it.\n' >> "$GITHUB_STEP_SUMMARY"
fi