{"id":15090152,"url":"https://github.com/tencentcloudbase/cloudbase-action","last_synced_at":"2025-10-05T23:31:30.594Z","repository":{"id":40390641,"uuid":"250414866","full_name":"TencentCloudBase/cloudbase-action","owner":"TencentCloudBase","description":"云开发 Tencent CloudBase Github Action 可以将 Github 项目自动部署到云开发环境，基于 CloudBase Framework，支持静态网站、云函数、云托管、小程序等项目","archived":true,"fork":false,"pushed_at":"2022-05-11T09:52:02.000Z","size":9607,"stargazers_count":102,"open_issues_count":0,"forks_count":10,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-01-15T23:20:47.812Z","etag":null,"topics":["actions","cloudbase","cloudbase-action","continuous-deployment","continuous-integration","deployment","gh-pages","github","pages","static-site","tcb","tencent"],"latest_commit_sha":null,"homepage":"https://cloudbase.net/","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TencentCloudBase.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-27T01:46:10.000Z","updated_at":"2024-12-23T19:08:55.000Z","dependencies_parsed_at":"2023-01-05T05:03:35.178Z","dependency_job_id":null,"html_url":"https://github.com/TencentCloudBase/cloudbase-action","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TencentCloudBase%2Fcloudbase-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TencentCloudBase%2Fcloudbase-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TencentCloudBase%2Fcloudbase-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TencentCloudBase%2Fcloudbase-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TencentCloudBase","download_url":"https://codeload.github.com/TencentCloudBase/cloudbase-action/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235461364,"owners_count":18994067,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["actions","cloudbase","cloudbase-action","continuous-deployment","continuous-integration","deployment","gh-pages","github","pages","static-site","tcb","tencent"],"created_at":"2024-09-25T09:22:26.483Z","updated_at":"2025-10-05T23:31:30.242Z","avatar_url":"https://github.com/TencentCloudBase.png","language":"Shell","readme":"![Tecent CloudBase](assets/logo.png)\n\n\u003c!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --\u003e\n[![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square)](#contributors-)\n\u003c!-- ALL-CONTRIBUTORS-BADGE:END --\u003e\n\n# Tencent CloudBase Github Action\n\n[![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/TencentCloudBase/cloudbase-action?label=Actions\u0026logo=github)](https://github.com/marketplace/actions/tencent-cloudbase-github-action) [![.github/workflows/main.yml](https://github.com/TencentCloudBase/cloudbase-action/workflows/.github/workflows/main.yml/badge.svg)](https://github.com/TencentCloudBase/cloudbase-action/actions)\n\n云开发 Tencent CloudBase Github Action 借力于 [CloudBase Framework](https://github.com/Tencent/cloudbase-framework)，可以将 Github 项目自动部署到云开发环境\n\n如果你目前使用的是 Tencent CloudBase Github Action V1 版本，请参考 [V1 README](https://github.com/TencentCloudBase/cloudbase-action/blob/3354b442713265aa9d7c5bf03b0b8cb0173f546f/README.md)，推荐使用 V2 版本以获取更多功能\n\n[🚀 在项目中使用此扩展](https://github.com/marketplace/actions/tencent-cloudbase-github-action)\n\n- 云开发官网地址： [https://cloudbase.net/](https://cloudbase.net/)\n- 云开发控制台地址： [https://console.cloud.tencent.com/tcb](https://console.cloud.tencent.com/tcb)\n\n支持列表：\n\n- 部署静态网站\n- 部署云函数\n- 部署到云托管环境\n- 部署微信小程序应用\n- 配置登录鉴权和云数据库\n\n完整列表请查看[插件介绍](https://docs.cloudbase.net/framework/plugins/)\n\n## 输入参数\n\n\u003e 提示：标注 🔐 的参数属于敏感信息，需要放在项目的 `secret` 存储中，用法可以参考最后的实例\n\n### `secretId` 🔐\n\n**Required** 云开发的访问密钥 secretId.\n\n在腾讯云[访问管理](https://console.cloud.tencent.com/cam/capi)页面获取\n\n### `secretKey` 🔐\n\n**Required** 云开发的访问密钥 secretKey.\n\n在腾讯云[访问管理](https://console.cloud.tencent.com/cam/capi)页面获取\n\n### `envId` 🔐\n\n**Required** 云开发的环境 id envId.\n\n可以在云开发的[控制台](https://console.cloud.tencent.com/tcb/env/index)获取\n\n## 配置文件\n\n请**确保**项目根目录存在 `cloudbaserc.json` 文件并配置好 CloudBase Framework，[参考教程](https://docs.cloudbase.net/framework/config.html#pei-zhi-shuo-ming)\n\n如需配置部署**地域**，请参考[配置字段](https://docs.cloudbase.net/cli-v1/config.html#zi-duan)\n\n\u003e 如果你的项目正在使用 CloudBase Framework，那么此 Action 就是 0 配置的\n\n然后请根据你的需求引入相关插件，支持[自动检测生成插件配置](https://docs.cloudbase.net/framework/plugins/#zi-dong-jian-ce-sheng-cheng-cha-jian-pei-zhi)或[手动填写插件配置](https://docs.cloudbase.net/framework/plugins/#zi-dong-jian-ce-sheng-cheng-cha-jian-pei-zhi)\n\n## 参考示例\n\n**以下示例将演示：如何快速部署云函数到 CloudBase(同时设定部署的私密环境变量)**\n\n1. 编写如下的 Github Action 文件 `.github/workflows/main.yml`\n\n   ```yaml\n   on: [push]\n\n   jobs:\n     deploy:\n       runs-on: ubuntu-latest\n       name: Tencent Cloudbase Github Action Example\n       steps:\n         - name: Checkout\n           uses: actions/checkout@v2\n         - name: Deploy to Tencent CloudBase\n           uses: TencentCloudBase/cloudbase-action@v2.0.1\n           with:\n             secretId: ${{secrets.secretId}}\n             secretKey: ${{secrets.secretKey}}\n             envId: ${{secrets.envId}}\n   ```\n\n   假设我们在部署时需要设置私密型的环境变量(比如小程序 `appid` 或访问数据库的 `accessToken`)，请在以上代码中新增以下内容：\n\n   ```diff\n    name: Tencent Cloudbase Github Action Example\n   +env:\n   +  accessToken: ${{ secrets.accessToken }}\n   ```\n\n   其中 `env` 下的 `accessToken` 键值对是我们[部署时设置的环境变量](https://docs.github.com/en/actions/reference/environment-variables#about-environment-variables)，它的功能与本地的 `.env` 文件相同\n\n2. 在项目中配置 `cloudbaserc.json` 文件并引入我们刚刚配置的环境变量：\n\n   ```json\n   {\n     \"envId\": \"{{env.ENV_ID}}\",\n     \"version\": \"2.0\",\n     \"framework\": {\n       \"name\": \"gh-actions-test\",\n       \"plugins\": {\n         \"func\": {\n           \"use\": \"@cloudbase/framework-plugin-function\",\n           \"inputs\": {\n             \"functions\": [\n               {\n                 \"name\": \"example\",\n                 \"memorySize\": 128,\n                 \"timeout\": 5,\n                 \"runtime\": \"Nodejs10.15\",\n                 \"handler\": \"index.main\",\n                 \"envVariables\": {\n                   \"accessToken\": \"{{env.accessToken}}\"\n                 }\n               }\n             ]\n           }\n         }\n       }\n     }\n   }\n   ```\n\n3. 在项目 Settings/Secrets 里设置 `secretId`, `secretKey`, `envId`, `accessToken` 信息\n\n   ![secrets](assets/secrets.png)\n\n4. 配置完成后，提交代码到 Github 时，就会自动部署项目中的 `example` 函数到云开发中，即时函数的环境变量也会设置成功\n\n## 谁在用 Tencent CloudBase Github Action\n\n- [Linux 中国: TLDR 命令查询工具](https://github.com/LCTT/tldr.linux.cn)\n- [EndureBlaze/EndureBlaze.github.io](https://github.com/EndureBlaze/EndureBlaze.github.io)\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"http://www.beetcb.com\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/63141491?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003ebeet\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/TencentCloudBase/cloudbase-action/commits?author=beetcb\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://www.linkedin.com/in/zhaoxuan-wu-495b2a194/\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/22099504?v=4?s=100\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eZhaoxuan \"Tony\" Wu\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/TencentCloudBase/cloudbase-action/commits?author=TonyWu3027\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftencentcloudbase%2Fcloudbase-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftencentcloudbase%2Fcloudbase-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftencentcloudbase%2Fcloudbase-action/lists"}