github动作是否存在每个目标(环境)变量值或章鱼范围范围的变量当量?

发布于 2025-01-28 05:30:39 字数 615 浏览 3 评论 0 原文

希望通过动作部署到多个环境。环境是我们的逻辑环境,例如Dev,UAT,Pro等。所有环境都相同。

鉴于部署是部署X,Y,Z ,X,Y,Z是每个环境值不同的变量,在操作中处理此操作的最佳实践是什么?

章鱼具有范围的变量。定义一次和每个环境值。

我考虑过以下一些选项:

定义和:

  1. 使用环境秘密 - con是非秘密的可维护性(不能仅仅看到普通文本事物)
  2. 开关型在操作环境上以设置env vars(迄今为止最好)

=“ https://docs.github.com/en/actions/deployment/targeting-different-environments/ususe-environments-for-deployment操作环境 似乎是每环境差异化的方法,但是要保持github中的var值,并且感觉应该完全被外部化,因为没有“ config”的机制。

如果您遇到了此类案件,请告诉我。谢谢!

编辑:12因子应用程序说“在环境中存储配置”,我认为这意味着在AWS中,我具有每个ENV SSM参数,并使用GH操作环境将各自的参数值拉入env vars。这感觉最正确。

Looking to deploy with actions to multiple environments. Environments are our logical environments, like Dev, Uat, Pro, etc. Deploy mechanic is same for all environments.

Given that the deploy is deploy x, y, z, and x, y, z are variables with differing values for each environment, what is the best practice for handling this in actions?

Octopus has scoped variables. Defined once, and per-environment values.

Here are some options I considered:

Define Actions Environments and:

  1. Use Environment Secrets - con is maintainability for non-secrets (can't just see plain-text things)
  2. SWITCH-type statement on Actions Environment to set env vars (seems best so far)

The Actions Environments seems to be the way to go for per-environment differentiation, but it's smelling to keep the var values in GitHub and feeling like should be externalized completely as there's no mechanism for "config".

Please let me know if you have approached such case. Thanks!

Edit: 12-factor app says "store config in the environment" and I think that means in AWS, that I have per-env SSM params and use the GH Actions Environments to pull the respective params' values into env vars. This feels most correct.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文