Skip to content

Conversation

@AhsokaTano26
Copy link
Contributor

@AhsokaTano26 AhsokaTano26 commented Dec 12, 2025

1.使用 'if' 条件,确保此步骤仅在推送到 'main' 分支时运行,避免了 'enable' 属性的错误。
2.确保只有在标签生成步骤成功运行时(即在 main 分支 push 时),才执行构建和推送。
3.docker image推送时增加latest标签

1.使用 'if' 条件,确保此步骤仅在推送到 'main' 分支时运行,避免了 'enable' 属性的错误。2.确保只有在标签生成步骤成功运行时(即在 main 分支 push 时),才执行构建和推送。 3.docker image推送时增加latest标签
@AhsokaTano26 AhsokaTano26 changed the title Add conditional checks for Docker actions Docs: Add conditional checks for Docker actions Dec 12, 2025
@github-actions
Copy link
Contributor

@yanyongyu
Copy link
Member

action 的触发条件写的就是当 push tag 的时候才会执行啊,你这个 if 有什么意义?

@AhsokaTano26
Copy link
Contributor Author

具体细节有点忘了,但这个是增加latest标签是运行报错的解决方案
image

@yanyongyu yanyongyu added the documentation Improvements or additions to documentation label Dec 12, 2025
@AhsokaTano26
Copy link
Contributor Author

image
@yanyongyu
Copy link
Member

你的 tag 是打在了非 master branch 上?正确用法应该是 type=raw,value=latest,enable={{is_default_branch}}

另外我觉得你这个属于自定义行为了,不应该放到文档里。

@AhsokaTano26
Copy link
Contributor Author

我思考的是有latest标签,就不需要每次去查看hash值了。不过确实可以自己修改,那就close?

@yanyongyu
Copy link
Member

action会把你 push tag 的版本打到镜像上,也不需要你看 hash 啊

@AhsokaTano26
Copy link
Contributor Author

是拉取的时候,因为我实践中机子没公网ip,实现不了action的自动拉取构建,每次需要去dockerhub查看

@yanyongyu
Copy link
Member

那你直接加上这个 latest tag 就可以了

@yanyongyu yanyongyu changed the title Docs: Add conditional checks for Docker actions Docs: Docker 部署镜像添加 latest tag Dec 12, 2025
@AhsokaTano26
Copy link
Contributor Author

OK,那我等会把两个判断删了

Removed conditional checks for generating tags and building/publishing.
@yanyongyu
Copy link
Member

你有试过这么写对吗 🤔 不需要 enable 参数了吗?

@AhsokaTano26
Copy link
Contributor Author

我这会试试

@AhsokaTano26
Copy link
Contributor Author

刚进行测试,是可用的
image

@yanyongyu
Copy link
Member

你这测试的是 push branch 不是 tag?另外文档同步更新一下其他几个版本的文件

@AhsokaTano26
Copy link
Contributor Author

测试的是 push branch,同步更新我抽空搞

@yanyongyu
Copy link
Member

@AhsokaTano26 测试过 push tag 了吗?更新还没有同步。

@AhsokaTano26
Copy link
Contributor Author

十分抱歉,最近考试周,可能得等到1月5日考完才能继续测试

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

2 participants