Skip to content

Commit 5793bc3

Browse files
committed
feat: add Docker Hub description update functionality
- Introduced a new input parameter `dockerhub_description_path` in the deploy-tag workflow to specify the path for the Docker Hub description update. - Added a new step in the workflow to utilize the `peter-evans/dockerhub-description` action for updating the Docker Hub description using the specified README file. - Created a new `dev.md` file to outline a todo list for future enhancements and changes related to the project.
1 parent a0d3828 commit 5793bc3

File tree

3 files changed

+76
-63
lines changed

3 files changed

+76
-63
lines changed

.github/workflows/deploy-tag.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ on:
2929
required: false
3030
type: string
3131

32+
dockerhub_description_path:
33+
description: 'dockerhub description update path'
34+
default: 'README.md'
35+
required: false
36+
type: string
37+
3238
permissions: # https://docs.github.com/actions/using-workflows/workflow-syntax-for-github-actions#permissions
3339
contents: write
3440
discussions: write
@@ -76,3 +82,12 @@ jobs:
7682
# **/*.zip
7783
# **/*.tar.gz
7884
# **/*.sha256
85+
86+
- name: Docker Hub Description
87+
# https://github.com/marketplace/actions/docker-hub-description
88+
uses: peter-evans/dockerhub-description@v5
89+
with:
90+
username: ${{ vars.ENV_DOCKERHUB_OWNER }}
91+
password: ${{ secrets.DOCKERHUB_TOKEN }}
92+
repository: ${{ vars.ENV_DOCKERHUB_OWNER }}/${{ vars.ENV_DOCKERHUB_REPO_NAME }}
93+
readme-filepath: ${{ inputs.dockerhub_description_path }}

README.md

Lines changed: 3 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -29,72 +29,12 @@ $ sudo chmod +x /usr/local/bin/golang-project-temple-base
2929
$ golang-project-temple-base --help
3030
```
3131

32-
### todo-list
33-
34-
- rename `bridgewwater/template-docker-golang-exec-build` to new github url
35-
- go cli repo [https://github.com/bridgewwater/golang-project-temple-base](https://github.com/bridgewwater/golang-project-temple-base)
36-
- rename go cli target version `GO_PKG_RELEASE_VERSION=2.1.0` (do not add prefix `v`)
37-
- rename go cli target GO_SRC_PATH `github.com/bridgewwater/golang-project-temple-base`
38-
- rename go cli target url `https://${GO_ENV_PACKAGE_NAME}.git`
39-
- rename go cli target Build PATH `build/${GO_ENV_ROOT_BUILD_BIN_NAME}`
40-
- rename go cli target exec build entrance path `cmd/golang-project-temple-base/main.go` to new
41-
- rename go cli target `golang-project-temple-base` to new exec tools name
42-
- rename go cli target build flag `-installsuffix cgo` to new
43-
- rename go cli target ENTRYPOINT `/bin/golang-project-temple-base`
44-
- rename local `INFO_TEST_BUILD_DOCKER_CONTAINER_ARGS` at Makefile
45-
- rename docker hub user `template-hub-user` to new org or user
46-
- rename docker hub `template-hub-user/template-docker-golang-exec-build` to new docker image name
47-
48-
- rename docker repo name at `docker-bake.hcl`
49-
- `template-docker-golang-exec-build` to new docker image name
50-
- `image-all` to change `platforms`
51-
52-
- use github action for this workflow push to docker hub, must add
53-
- variables `ENV_DOCKERHUB_OWNER` user of docker hub
54-
- variables `ENV_DOCKERHUB_REPO_NAME` repo name of docker hub
55-
- add [secrets](https://github.com/bridgewwater/template-docker-golang-exec-build/settings/secrets/actions) `New repository secret` name `DOCKERHUB_TOKEN` from [hub.docker](https://hub.docker.com/settings/security)
56-
57-
- change `DOCKER_IMAGE_PLATFORMS: linux/amd64,linux/arm64/v8` to your need [docker buildx](https://docs.docker.com/buildx/working-with-buildx/)
58-
- also change `jobs.docker-image-buildx.strategy.matrix.docker_image.[platform]` same as `DOCKER_IMAGE_PLATFORMS`
59-
- change `push_remote_flag: ${{ github.event.pull_request.merged == true }}` to let latest tag push to docker hub
60-
61-
6232
## source repo
6333

6434
[https://github.com/bridgewwater/template-docker-golang-exec-build](https://github.com/bridgewwater/template-docker-golang-exec-build)
6535

66-
### env
67-
68-
- parent image `alpine` version `3.20.3`
69-
- minimum go image version: go 1.18
70-
- change `go 1.18`, `^1.18`, `1.18.10`, `1.18.10` to new go version
71-
72-
### dev mode
73-
74-
```bash
75-
# see help
76-
$ make help
77-
# see or check build env
78-
$ make env
79-
80-
# fast build
81-
$ make all
82-
# clean build
83-
$ make clean
84-
85-
# then test build as test/Dockerfile
86-
$ make dockerTestRestartLatest
87-
# clean test build
88-
$ make dockerTestPruneLatest
89-
```
90-
91-
## Contributing
92-
93-
[![Contributor Covenant](https://img.shields.io/badge/contributor%20covenant-v1.4-ff69b4.svg)](.github/CONTRIBUTING_DOC/CODE_OF_CONDUCT.md)
94-
[![GitHub contributors](https://img.shields.io/github/contributors/bridgewwater/template-docker-golang-exec-build)](https://github.com/bridgewwater/template-docker-golang-exec-build/graphs/contributors)
95-
96-
We welcome community contributions to this project.
9736

98-
Please read [Contributor Guide](.github/CONTRIBUTING_DOC/CONTRIBUTING.md) for more information on how to get started.
37+
## features
9938

100-
请阅读有关 [贡献者指南](.github/CONTRIBUTING_DOC/zh-CN/CONTRIBUTING.md) 以获取更多如何入门的信息
39+
- [ ] foo
40+
- [ ] bar

doc-dev/dev.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
### todo-list
2+
3+
- rename `bridgewwater/template-docker-golang-exec-build` to new github url
4+
- go cli repo [https://github.com/bridgewwater/golang-project-temple-base](https://github.com/bridgewwater/golang-project-temple-base)
5+
- rename go cli target version `GO_PKG_RELEASE_VERSION=2.1.0` (do not add prefix `v`)
6+
- rename go cli target GO_SRC_PATH `github.com/bridgewwater/golang-project-temple-base`
7+
- rename go cli target url `https://${GO_ENV_PACKAGE_NAME}.git`
8+
- rename go cli target Build PATH `build/${GO_ENV_ROOT_BUILD_BIN_NAME}`
9+
- rename go cli target exec build entrance path `cmd/golang-project-temple-base/main.go` to new
10+
- rename go cli target `golang-project-temple-base` to new exec tools name
11+
- rename go cli target build flag `-installsuffix cgo` to new
12+
- rename go cli target ENTRYPOINT `/bin/golang-project-temple-base`
13+
- rename local `INFO_TEST_BUILD_DOCKER_CONTAINER_ARGS` at Makefile
14+
- rename docker hub user `template-hub-user` to new org or user
15+
- rename docker hub `template-hub-user/template-docker-golang-exec-build` to new docker image name
16+
17+
- rename docker repo name at `docker-bake.hcl`
18+
- `template-docker-golang-exec-build` to new docker image name
19+
- `image-all` to change `platforms`
20+
21+
- use github action for this workflow push to docker hub, must add
22+
- variables `ENV_DOCKERHUB_OWNER` user of docker hub
23+
- variables `ENV_DOCKERHUB_REPO_NAME` repo name of docker hub
24+
- add [secrets](https://github.com/bridgewwater/template-docker-golang-exec-build/settings/secrets/actions) `New repository secret` name `DOCKERHUB_TOKEN` from [hub.docker](https://hub.docker.com/settings/security)
25+
26+
- change `DOCKER_IMAGE_PLATFORMS: linux/amd64,linux/arm64/v8` to your need [docker buildx](https://docs.docker.com/buildx/working-with-buildx/)
27+
- also change `jobs.docker-image-buildx.strategy.matrix.docker_image.[platform]` same as `DOCKER_IMAGE_PLATFORMS`
28+
- change `push_remote_flag: ${{ github.event.pull_request.merged == true }}` to let latest tag push to docker hub
29+
30+
31+
## source repo
32+
33+
[https://github.com/bridgewwater/template-docker-golang-exec-build](https://github.com/bridgewwater/template-docker-golang-exec-build)
34+
35+
### env
36+
37+
- parent image `alpine` version `3.20.3`
38+
- minimum go image version: go 1.18
39+
- change `go 1.18`, `^1.18`, `1.18.10`, `1.18.10` to new go version
40+
41+
### dev mode
42+
43+
```bash
44+
# see help
45+
$ make help
46+
# see or check build env
47+
$ make env
48+
49+
# fast build
50+
$ make all
51+
# clean build
52+
$ make clean
53+
54+
# then test build as test/Dockerfile
55+
$ make dockerTestRestartLatest
56+
# clean test build
57+
$ make dockerTestPruneLatest
58+
```

0 commit comments

Comments
 (0)