58 lines
1.8 KiB
YAML
58 lines
1.8 KiB
YAML
name: Update Docker Hub Description
|
||
|
||
# ==============================================================================
|
||
# 🔧 自動更新 Docker Hub Repository Overview
|
||
# ==============================================================================
|
||
# 觸發時機:
|
||
# 1. push 到 main 分支時(README.md 或此 workflow 更改)
|
||
# 2. Release workflow 成功完成後
|
||
# 3. 手動觸發
|
||
# ==============================================================================
|
||
|
||
env:
|
||
# Docker Hub Repository 名稱(與 GitHub repo 不同)
|
||
DOCKER_IMAGE: convertx/convertx-cn
|
||
|
||
on:
|
||
push:
|
||
branches:
|
||
- main
|
||
paths:
|
||
- README.md
|
||
- .github/workflows/dockerhub-description.yml
|
||
# Release 完成後觸發
|
||
workflow_run:
|
||
workflows: ["Release"]
|
||
types:
|
||
- completed
|
||
# 允許手動觸發
|
||
workflow_dispatch:
|
||
|
||
jobs:
|
||
dockerHubDescription:
|
||
runs-on: ubuntu-latest
|
||
# 條件:push / 手動觸發 / Release 成功
|
||
if: |
|
||
github.event_name == 'push' ||
|
||
github.event_name == 'workflow_dispatch' ||
|
||
(github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success')
|
||
|
||
steps:
|
||
- uses: actions/checkout@v4
|
||
|
||
- name: Update Docker Hub Description
|
||
# 非關鍵流程 - 失敗不阻擋
|
||
continue-on-error: true
|
||
uses: peter-evans/dockerhub-description@v4
|
||
with:
|
||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||
repository: ${{ env.DOCKER_IMAGE }}
|
||
short-description: ${{ github.event.repository.description }}
|
||
enable-url-completion: true
|
||
|
||
- name: Summary
|
||
run: |
|
||
echo "## 📝 Docker Hub Description Update" >> $GITHUB_STEP_SUMMARY
|
||
echo "" >> $GITHUB_STEP_SUMMARY
|
||
echo "Repository: \`${{ env.DOCKER_IMAGE }}\`" >> $GITHUB_STEP_SUMMARY
|