{"id":52476,"date":"2024-12-03T12:20:40","date_gmt":"2024-12-03T04:20:40","guid":{"rendered":"https:\/\/fwq.ai\/blog\/52476\/"},"modified":"2024-12-03T12:20:40","modified_gmt":"2024-12-03T04:20:40","slug":"%e4%bd%bf%e7%94%a8-github-actions-%e4%b8%ba-vshell-%e5%ae%9e%e6%96%bd-ci-%e7%ae%a1%e9%81%93","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/52476\/","title":{"rendered":"\u4f7f\u7528 GitHub Actions \u4e3a VShell \u5b9e\u65bd CI \u7ba1\u9053"},"content":{"rendered":"<p><b><\/b>     <\/p>\n<h1>\u4f7f\u7528 GitHub Actions \u4e3a VShell \u5b9e\u65bd CI \u7ba1\u9053<\/h1>\n<p><span style=\"cursor: pointer\"><i><\/i>\u6536\u85cf<\/span>    <\/p>\n<p>\u54c8\u55bd\uff01\u5927\u5bb6\u597d\uff0c\u5f88\u9ad8\u5174\u53c8\u89c1\u9762\u4e86\uff0c\u6211\u662f\u7c73\u4e91\u7684\u4e00\u540d\u4f5c\u8005\uff0c\u4eca\u5929\u7531\u6211\u7ed9\u5927\u5bb6\u5e26\u6765\u4e00\u7bc7<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u300a\u4f7f\u7528 GitHub Actions \u4e3a VShell \u5b9e\u65bd CI \u7ba1\u9053\u300b<\/span>\uff0c\u672c\u6587\u4e3b\u8981\u4f1a\u8bb2\u5230<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\"><\/span>\u7b49\u7b49\u77e5\u8bc6\u70b9\uff0c\u5e0c\u671b\u5927\u5bb6\u4e00\u8d77\u5b66\u4e60\u8fdb\u6b65\uff0c\u4e5f\u6b22\u8fce\u5927\u5bb6\u5173\u6ce8\u3001\u70b9\u8d5e\u3001\u6536\u85cf\u3001\u8f6c\u53d1! \u4e0b\u9762\u5c31\u4e00\u8d77\u6765\u770b\u770b\u5427\uff01<\/p>\n<h2> \u4ecb\u7ecd <\/h2>\n<p>\u672c\u5468\uff0c\u6211\u6df1\u5165\u7814\u7a76\u4e86\u4f7f\u7528 GitHub Actions \u8bbe\u7f6e\u6301\u7eed\u96c6\u6210 (CI) \u7ba1\u9053\uff0c\u540c\u65f6\u8fd8\u6269\u5c55\u4e86\u6211\u7684\u9879\u76ee VShell \u7684\u5355\u5143\u6d4b\u8bd5\u5957\u4ef6\u3002\u8fd9\u4e2a\u8fc7\u7a0b\u589e\u5f3a\u4e86\u6211\u5bf9 CI \u539f\u7406\u3001\u81ea\u52a8\u5316\u6d4b\u8bd5\u4ee5\u53ca\u5e2e\u52a9\u5f00\u53d1\u4eba\u5458\u786e\u4fdd\u53ef\u9760\u4ee3\u7801\u4ea4\u4ed8\u7684\u5de5\u5177\u7684\u7406\u89e3\u3002<\/p>\n<h2> \u4ec0\u4e48\u662f\u6301\u7eed\u96c6\u6210\uff1f <\/h2>\n<p>\u6301\u7eed\u96c6\u6210\u662f\u4e00\u79cd\u5f00\u53d1\u5b9e\u8df5\uff0c\u5176\u4e2d\u4ee3\u7801\u66f4\u6539\u4f1a\u81ea\u52a8\u6d4b\u8bd5\u5e76\u9891\u7e41\u96c6\u6210\u5230\u5171\u4eab\u5b58\u50a8\u5e93\u4e2d\u3002\u901a\u8fc7\u5229\u7528 CI \u7ba1\u9053\uff0c\u5f00\u53d1\u4eba\u5458\u53ef\u4ee5\u5728\u5f00\u53d1\u5468\u671f\u7684\u65e9\u671f\u68c0\u6d4b\u5e76\u89e3\u51b3\u95ee\u9898\uff0c\u4ece\u800c\u63d0\u9ad8\u4ee3\u7801\u8d28\u91cf\u5e76\u964d\u4f4e\u96c6\u6210\u98ce\u9669\u3002 CI\/CD \u7ba1\u9053\u4f7f\u6211\u4eec\u80fd\u591f\u81ea\u52a8\u6784\u5efa\u3001\u6d4b\u8bd5\u548c\u90e8\u7f72\u5e94\u7528\u7a0b\u5e8f\uff0c\u4ece\u800c\u52a0\u901f\u5f00\u53d1\u5e76\u63d0\u9ad8\u53ef\u9760\u6027\u3002<\/p>\n<h2> \u4f7f\u7528 GitHub Actions \u8bbe\u7f6e CI \u7ba1\u9053 <\/h2>\n<p>\u6709\u8bb8\u591a\u53ef\u7528\u7684 CI \u5de5\u5177\u2014\u2014Jenkins\u3001CircleCI\u3001TravisCI \u548c GitLab CI \u7b49\u2014\u2014\u4f46\u672c\u5468\uff0c\u6211\u4e13\u6ce8\u4e8e GitHub Actions \u6765\u4e3a\u6211\u7684\u5e94\u7528\u7a0b\u5e8f\u5b9e\u73b0 CI\/CD\u3002 GitHub Actions \u76f4\u63a5\u5728 GitHub \u4e2d\u63d0\u4f9b\u96c6\u6210\u3001\u7b80\u5355\u7684\u8bbe\u7f6e\uff0c\u4f7f\u5176\u6210\u4e3a\u6211\u7684\u9879\u76ee\u7684\u7edd\u4f73\u9009\u62e9\u3002<\/p>\n<p>\u4e3a\u6211\u7684\u9879\u76ee\u914d\u7f6e GitHub \u64cd\u4f5c \u4e3a\u4e86\u8bbe\u7f6e CI \u7ba1\u9053\uff0c\u6211\u5bfc\u822a\u5230 GitHub \u5b58\u50a8\u5e93\u7684\u201c\u64cd\u4f5c\u201d\u9009\u9879\u5361\u5e76\u9009\u62e9 Node.js \u6a21\u677f\uff0c\u56e0\u4e3a\u6211\u7684\u5e94\u7528\u7a0b\u5e8f\u57fa\u4e8e JavaScript \u5e76\u5728 Node.js \u4e0a\u8fd0\u884c\u3002\u8fd9\u751f\u6210\u4e86\u4e00\u4e2a\u5b9a\u4e49 CI \u7ba1\u9053\u884c\u4e3a\u7684 .yml \u914d\u7f6e\u6587\u4ef6\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241120\/1732110531673de8c3bbb70.png\" style=\"max-width:100%\" class=\"aligncenter\" title=\"\u4f7f\u7528 GitHub Actions \u4e3a VShell \u5b9e\u65bd CI \u7ba1\u9053\u63d2\u56fe\" alt=\"\u4f7f\u7528 GitHub Actions \u4e3a VShell \u5b9e\u65bd CI \u7ba1\u9053\u63d2\u56fe\" \/><\/p>\n<p>\u7406\u89e3 YAML \u914d\u7f6e \u5bf9\u4e8e CI \u65b0\u624b\u6765\u8bf4\uff0c.yml \u6587\u4ef6\u53ef\u80fd\u770b\u8d77\u6765\u4ee4\u4eba\u751f\u754f\u3002\u4ee5\u4e0b\u662f\u5176\u5de5\u4f5c\u539f\u7406\u7684\u8be6\u7ec6\u8bf4\u660e\uff1a<\/p>\n<p><strong>\u89e6\u53d1\u7ba1\u9053<\/strong>\uff1a\u7ba1\u9053\u8bbe\u7f6e\u4e3a\u5728\u5411\u4e3b\u5206\u652f\u53d1\u51fa\u63a8\u9001\u6216\u62c9\u53d6\u8bf7\u6c42\u65f6\u8fd0\u884c\uff0c\u4f7f\u7528 on \u5173\u952e\u5b57\u5b9a\u4e49\u8fd9\u4e9b\u89e6\u53d1\u5668\u3002<\/p>\n<p><strong>\u5b9a\u4e49\u4f5c\u4e1a<\/strong>\uff1a\u914d\u7f6e\u5305\u62ec\u89e6\u53d1 CI \u7ba1\u9053\u65f6\u6267\u884c\u7684\u4e00\u7cfb\u5217\u4f5c\u4e1a\u3002\u8fd9\u4e9b\u4f5c\u4e1a\u6307\u5b9a Ubuntu \u64cd\u4f5c\u7cfb\u7edf\u6784\u5efa\u73af\u5883\uff0c\u8de8\u4e0d\u540c Node.js \u7248\u672c\u8fdb\u884c\u6d4b\u8bd5\uff0c\u5e76\u5305\u542b\u8bbe\u7f6e\u548c\u6267\u884c\u8fd0\u884c\u65f6\u73af\u5883\u7684\u6b65\u9aa4\u3002\u6700\u540e\uff0c\u81ea\u52a8\u8fd0\u884c\u6d4b\u8bd5\u6765\u9a8c\u8bc1\u4ee3\u7801\u3002<\/p>\n<h2> \u6211\u7684\u7ecf\u5386 <\/h2>\n<p>\u73af\u5883\u53d8\u91cf\u914d\u7f6e\u5728\u6211\u7684\u521d\u59cb\u7ba1\u9053\u8bbe\u7f6e\u671f\u95f4\uff0c\u6211\u9047\u5230\u4e86\u4e0e GROQ_API_KEY \u76f8\u5173\u7684\u9519\u8bef\uff0c\u8fd9\u5bf9\u4e8e\u67d0\u4e9b\u6d4b\u8bd5\u81f3\u5173\u91cd\u8981\u5e76\u5728\u6211\u7684\u672c\u5730 .env \u6587\u4ef6\u4e2d\u5b9a\u4e49\u3002\u867d\u7136\u6d4b\u8bd5\u5728\u672c\u5730\u987a\u5229\u8fd0\u884c\uff0c\u4f46 GitHub Actions \u65e0\u6cd5\u8bbf\u95ee\u8be5\u53d8\u91cf\uff0c\u5bfc\u81f4\u8fd0\u884c\u5931\u8d25\u3002<\/p>\n<p><strong>\u89e3\u51b3\u65b9\u6848<\/strong>\uff1a\u8bbe\u7f6e GitHub \u673a\u5bc6 \u4e3a\u4e86\u89e3\u51b3\u6b64\u95ee\u9898\uff0c\u6211\u5728 GitHub \u5b58\u50a8\u5e93\u8bbe\u7f6e\u4e2d\u4e3a API \u5bc6\u94a5\u914d\u7f6e\u4e86\u4e00\u4e2a\u673a\u5bc6\u53d8\u91cf\u3002\u4ee5\u4e0b\u662f\u4fee\u590d\u7684\u5feb\u901f\u6458\u8981\uff1a<\/p>\n<ul>\n<li>\u6211\u5bfc\u822a\u5230\u5b58\u50a8\u5e93\u7684\u8bbe\u7f6e\uff0c\u5e76\u5728 Settings &gt; Secrets \u4e0b\u6dfb\u52a0 GROQ_API_KEY \u4f5c\u4e3a\u79d8\u5bc6\u3002<\/li>\n<li>\u5728 .yml \u6587\u4ef6\u4e2d\uff0c\u6211\u6dfb\u52a0\u4e86 env \u5173\u952e\u5b57\u6765\u6307\u793a\u7ba1\u9053\u68c0\u7d22\u6b64\u5bc6\u94a5\uff0c\u786e\u4fdd\u6d4b\u8bd5\u53ef\u4ee5\u8bbf\u95ee\u5b83\uff0c\u800c\u65e0\u9700\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u786c\u7f16\u7801\u654f\u611f\u6570\u636e\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u672c\u6587\u7684\u5168\u90e8\u5185\u5bb9\u4e86\uff0c\u662f\u5426\u6709\u987a\u5229\u5e2e\u52a9\u4f60\u89e3\u51b3\u95ee\u9898\uff1f\u82e5\u662f\u80fd\u7ed9\u4f60\u5e26\u6765\u5b66\u4e60\u4e0a\u7684\u5e2e\u52a9\uff0c\u8bf7\u5927\u5bb6\u591a\u591a\u652f\u6301\u7c73\u4e91\uff01\u66f4\u591a\u5173\u4e8e\u6587\u7ae0\u7684\u76f8\u5173\u77e5\u8bc6\uff0c\u4e5f\u53ef\u5173\u6ce8\u7c73\u4e91\u516c\u4f17\u53f7\u3002<\/p>\n<p>      \u7248\u672c\u58f0\u660e \u672c\u6587\u8f6c\u8f7d\u4e8e\uff1adev.to \u5982\u6709\u4fb5\u72af\uff0c\u8bf7\u8054\u7cfb\u5220\u9664    <\/p>\n<dl>\n<dt><\/dt>\n<dd>\n   Anaconda\u7684Channel\u662f\u4ec0\u4e48\uff1f\u5982\u4f55\u6dfb\u52a0\u3001\u7ba1\u7406\u548c\u542f\u7528\/\u7981\u7528\u5b83\uff1f\n <\/dd>\n<\/dl>\n","protected":false},"excerpt":{"rendered":"<p>\u4f7f\u7528 GitHub Actions \u4e3a VShell \u5b9e\u65bd CI \u7ba1\u9053 \u6536\u85cf \u54c8\u55bd\uff01\u5927\u5bb6\u597d\uff0c\u5f88\u9ad8\u5174\u53c8\u89c1\u9762\u4e86\uff0c\u6211\u662f\u7c73\u4e91\u7684\u4e00\u540d\u4f5c\u8005\uff0c\u4eca\u5929\u7531\u6211\u7ed9\u5927\u5bb6\u5e26\u6765\u4e00\u7bc7\u300a\u4f7f\u7528 GitHub Actions \u4e3a VShell \u5b9e\u65bd CI \u7ba1\u9053\u300b\uff0c\u672c\u6587\u4e3b\u8981\u4f1a\u8bb2\u5230\u7b49\u7b49\u77e5\u8bc6\u70b9\uff0c\u5e0c\u671b\u5927\u5bb6\u4e00\u8d77\u5b66\u4e60\u8fdb\u6b65\uff0c\u4e5f\u6b22\u8fce\u5927\u5bb6\u5173\u6ce8\u3001\u70b9\u8d5e\u3001\u6536\u85cf\u3001\u8f6c\u53d1! \u4e0b\u9762\u5c31\u4e00\u8d77\u6765\u770b\u770b\u5427\uff01 \u4ecb\u7ecd \u672c\u5468\uff0c\u6211\u6df1\u5165\u7814\u7a76\u4e86\u4f7f\u7528 GitHub Actions \u8bbe\u7f6e\u6301\u7eed\u96c6\u6210 (CI) \u7ba1\u9053\uff0c\u540c\u65f6\u8fd8\u6269\u5c55\u4e86\u6211\u7684\u9879\u76ee VShell \u7684\u5355\u5143\u6d4b\u8bd5\u5957\u4ef6\u3002\u8fd9\u4e2a\u8fc7\u7a0b\u589e\u5f3a\u4e86\u6211\u5bf9 CI \u539f\u7406\u3001\u81ea\u52a8\u5316\u6d4b\u8bd5\u4ee5\u53ca\u5e2e\u52a9\u5f00\u53d1\u4eba\u5458\u786e\u4fdd\u53ef\u9760\u4ee3\u7801\u4ea4\u4ed8\u7684\u5de5\u5177\u7684\u7406\u89e3\u3002 \u4ec0\u4e48\u662f\u6301\u7eed\u96c6\u6210\uff1f \u6301\u7eed\u96c6\u6210\u662f\u4e00\u79cd\u5f00\u53d1\u5b9e\u8df5\uff0c\u5176\u4e2d\u4ee3\u7801\u66f4\u6539\u4f1a\u81ea\u52a8\u6d4b\u8bd5\u5e76\u9891\u7e41\u96c6\u6210\u5230\u5171\u4eab\u5b58\u50a8\u5e93\u4e2d\u3002\u901a\u8fc7\u5229\u7528 CI \u7ba1\u9053\uff0c\u5f00\u53d1\u4eba\u5458\u53ef\u4ee5\u5728\u5f00\u53d1\u5468\u671f\u7684\u65e9\u671f\u68c0\u6d4b\u5e76\u89e3\u51b3\u95ee\u9898\uff0c\u4ece\u800c\u63d0\u9ad8\u4ee3\u7801\u8d28\u91cf\u5e76\u964d\u4f4e\u96c6\u6210\u98ce\u9669\u3002 CI\/CD \u7ba1\u9053\u4f7f\u6211\u4eec\u80fd\u591f\u81ea\u52a8\u6784\u5efa\u3001\u6d4b\u8bd5\u548c\u90e8\u7f72\u5e94\u7528\u7a0b\u5e8f\uff0c\u4ece\u800c\u52a0\u901f\u5f00\u53d1\u5e76\u63d0\u9ad8\u53ef\u9760\u6027\u3002 \u4f7f\u7528 GitHub Actions \u8bbe\u7f6e CI \u7ba1\u9053 \u6709\u8bb8\u591a\u53ef\u7528\u7684 CI \u5de5\u5177\u2014\u2014Jenkins\u3001CircleCI\u3001TravisCI \u548c GitLab CI \u7b49\u2014\u2014\u4f46\u672c\u5468\uff0c\u6211\u4e13\u6ce8\u4e8e GitHub Actions \u6765\u4e3a\u6211\u7684\u5e94\u7528\u7a0b\u5e8f\u5b9e\u73b0 CI\/CD\u3002 GitHub Actions \u76f4\u63a5\u5728 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-52476","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/52476","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=52476"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/52476\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=52476"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=52476"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=52476"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}