File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11name : Build and Push Images
22
33" on " :
4- workflow_dispatch :
5- inputs :
6- image_tag :
7- description : " Docker image tag to publish"
8- required : true
9- default : " latest"
4+ push :
5+ branches :
6+ - main
107
118permissions :
129 contents : read
@@ -50,14 +47,12 @@ jobs:
5047 REGISTRY : ${{ secrets.ALIYUN_REGISTRY }}
5148 NAMESPACE : ${{ secrets.ALIYUN_NAME_SPACE }}
5249 IMAGE : ${{ matrix.image }}
53- IMAGE_TAG : ${{ inputs.image_tag }}
5450 run : |
5551 set -euo pipefail
56- VERSION="${IMAGE_TAG:-latest}"
5752
5853 {
5954 echo "tags<<EOF"
60- echo "${REGISTRY}/${NAMESPACE}/${IMAGE}:${VERSION} "
55+ echo "${REGISTRY}/${NAMESPACE}/${IMAGE}:latest "
6156 echo "EOF"
6257 } >> "$GITHUB_OUTPUT"
6358
Original file line number Diff line number Diff line change @@ -167,7 +167,7 @@ sudo docker compose up -d
167167| ` ALIYUN_REGISTRY_USER ` | 仓库用户名 |
168168| ` ALIYUN_REGISTRY_PASSWORD ` | 仓库密码或访问凭证 |
169169
170- 手工运行 ` Build and Push Images ` ,填写镜像 tag。 ` .env ` 中的 ` IMAGE_TAG ` 要和推送的 tag 一致 。
170+ 提交到 ` main ` 后会自动运行 ` Build and Push Images ` ,并把本项目镜像推送为 ` latest ` 。默认 ` .env ` 中的 ` IMAGE_TAG=latest ` 可直接匹配该发布流程 。
171171
172172## 开发
173173
You can’t perform that action at this time.
0 commit comments