{"id":88357,"date":"2026-08-01T01:24:24","date_gmt":"2026-07-31T17:24:24","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/88357.html"},"modified":"2026-08-01T01:24:24","modified_gmt":"2026-07-31T17:24:24","slug":"github-actions-%e8%87%aa%e5%8a%a8%e5%8c%96%e8%bf%90%e7%bb%b4%e5%ae%9e%e6%88%98%ef%bc%9a%e4%bb%8e%e5%85%a5%e9%97%a8%e5%88%b0%e4%bc%81%e4%b8%9a%e7%ba%a7%e8%90%bd%e5%9c%b0","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/88357.html","title":{"rendered":"GitHub Actions \u81ea\u52a8\u5316\u8fd0\u7ef4\u5b9e\u6218\uff1a\u4ece\u5165\u95e8\u5230\u4f01\u4e1a\u7ea7\u843d\u5730"},"content":{"rendered":"<h3>1. \u5f15\u8a00&#xff1a;\u4e3a\u4ec0\u4e48\u8981\u7528 GitHub Actions \u505a\u81ea\u52a8\u5316\u8fd0\u7ef4<\/h3>\n<p>\u5728\u8f6f\u4ef6\u5de5\u7a0b\u9886\u57df&#xff0c;\u81ea\u52a8\u5316\u65e9\u5df2\u4e0d\u662f\u201c\u9526\u4e0a\u6dfb\u82b1\u201d&#xff0c;\u800c\u662f\u56e2\u961f\u6548\u7387\u7684\u751f\u547d\u7ebf\u3002\u4ece\u6700\u65e9\u7684 Cron \u5b9a\u65f6\u811a\u672c&#xff0c;\u5230 Jenkins \u79f0\u9738 CI \u670d\u52a1\u5668\u5e02\u573a&#xff0c;\u518d\u5230\u5982\u4eca\u4e91\u539f\u751f\u65f6\u4ee3 CI\/CD \u4e0e\u8fd0\u7ef4\u5de5\u5177\u7684\u767e\u82b1\u9f50\u653e&#xff0c;\u81ea\u52a8\u5316\u8fd0\u7ef4\u7684\u7406\u5ff5\u4e00\u8109\u76f8\u627f&#xff0c;\u4f46\u5de5\u5177\u5f62\u6001\u5df2\u53d1\u751f\u4e86\u6df1\u523b\u53d8\u9769\u3002<\/p>\n<p>GitHub Actions \u6b63\u662f\u8fd9\u573a\u53d8\u9769\u4e2d\u7684\u4f7c\u4f7c\u8005\u3002\u81ea 2019 \u5e74\u6b63\u5f0f\u63a8\u51fa\u4ee5\u6765&#xff0c;\u5b83\u51ed\u501f\u4e0e GitHub \u4ed3\u5e93\u7684\u6df1\u5ea6\u96c6\u6210\u3001\u5e9e\u5927\u7684\u793e\u533a\u751f\u6001&#xff0c;\u4ee5\u53ca\u201c\u914d\u7f6e\u5373\u4ee3\u7801\u201d\u7684 YAML \u58f0\u660e\u5f0f\u5199\u6cd5&#xff0c;\u8fc5\u901f\u6210\u4e3a\u5f00\u53d1\u8005\u4eec\u6784\u5efa CI\/CD \u6d41\u6c34\u7ebf\u548c\u81ea\u52a8\u5316\u8fd0\u7ef4\u811a\u672c\u7684\u9996\u9009\u4e4b\u4e00\u3002<\/p>\n<p>\u4e0e\u4f20\u7edf\u5de5\u5177\u5982 Jenkins \u6216 GitLab CI \u76f8\u6bd4&#xff0c;GitHub Actions \u6709\u51e0\u4e2a\u6838\u5fc3\u4f18\u52bf&#xff1a;<\/p>\n<ul>\n<li>\u96f6\u6258\u7ba1\u6210\u672c&#xff1a;\u65e0\u9700\u81ea\u5efa CI \u670d\u52a1\u5668&#xff0c;GitHub \u63d0\u4f9b\u4e91\u6258\u7ba1\u8fd0\u884c\u5668&#xff0c;\u5f00\u7bb1\u5373\u7528\u3002<\/li>\n<li>\u4e8b\u4ef6\u9a71\u52a8\u6a21\u578b&#xff1a;\u4e0d\u4ec5\u662f\u4ee3\u7801\u63a8\u9001&#xff0c;Issue \u521b\u5efa\u3001PR \u8bc4\u8bba\u3001\u5b9a\u65f6\u8c03\u5ea6\u3001\u624b\u52a8\u89e6\u53d1\u90fd\u80fd\u6210\u4e3a\u81ea\u52a8\u5316\u7684\u8d77\u70b9\u3002<\/li>\n<li>\u793e\u533a\u751f\u6001\u4e30\u5bcc&#xff1a;Actions Marketplace \u4e0a\u6709\u6570\u4e07\u4e2a\u73b0\u6210\u7684 Action&#xff0c;\u4ece\u90e8\u7f72\u5230\u901a\u77e5\u3001\u4ece\u5b89\u5168\u626b\u63cf\u5230\u6570\u636e\u5e93\u8fc1\u79fb&#xff0c;\u65e0\u9700\u91cd\u590d\u9020\u8f6e\u5b50\u3002<\/li>\n<li>\u4e0e GitHub \u751f\u6001\u65e0\u7f1d\u8854\u63a5&#xff1a;\u6743\u9650\u7ba1\u7406\u3001Secrets \u52a0\u5bc6\u3001Code Review \u96c6\u6210\u90fd\u5728\u540c\u4e00\u4e2a\u5e73\u53f0\u4e0a\u5b8c\u6210&#xff0c;\u51cf\u5c11\u4e86\u4e0a\u4e0b\u6587\u5207\u6362\u3002<\/li>\n<\/ul>\n<p>\u672c\u6587\u5c06\u4ece\u5b9e\u6218\u51fa\u53d1&#xff0c;\u7cfb\u7edf\u8bb2\u89e3 GitHub Actions \u7684\u6838\u5fc3\u6982\u5ff5\u3001\u5de5\u4f5c\u6d41\u8bed\u6cd5\u3001CI\/CD \u5b9e\u64cd\u3001\u81ea\u52a8\u5316\u8fd0\u7ef4\u96c6\u6210\u3001\u4f01\u4e1a\u7ea7\u5b89\u5168\u5b9e\u8df5\u4ee5\u53ca\u6210\u672c\u4f18\u5316\u7b56\u7565\u3002\u65e0\u8bba\u4f60\u662f\u521a\u63a5\u89e6 CI\/CD \u7684\u521d\u5b66\u8005&#xff0c;\u8fd8\u662f\u5e0c\u671b\u5c06\u73b0\u6709 Jenkins \u6d41\u6c34\u7ebf\u8fc1\u79fb\u5230 GitHub Actions \u7684 DevOps \u5de5\u7a0b\u5e08&#xff0c;\u90fd\u80fd\u5728\u5176\u4e2d\u627e\u5230\u53ef\u843d\u5730\u7684\u5b9e\u8df5\u65b9\u6848\u3002<\/p>\n<p>\u63a5\u4e0b\u6765\u7684\u5404\u7ae0\u5c06\u6309\u7167\u201c\u6982\u5ff5\u8ba4\u77e5 \u2192 \u8bed\u6cd5\u638c\u63e1 \u2192 \u5b9e\u6218\u6f14\u7ec3 \u2192 \u8fdb\u9636\u62d3\u5c55\u201d\u7684\u8def\u5f84\u9010\u6b65\u6df1\u5165&#xff0c;\u5efa\u8bae\u8bfb\u8005\u6309\u987a\u5e8f\u9605\u8bfb&#xff0c;\u5e76\u7ed3\u5408\u81ea\u5df1\u7684\u9879\u76ee\u52a8\u624b\u5b9e\u8df5\u3002<\/p>\n<h3>2. GitHub Actions \u6838\u5fc3\u6982\u5ff5\u901f\u89c8<\/h3>\n<p>\u5728\u52a8\u624b\u7f16\u5199\u7b2c\u4e00\u4e2a\u5de5\u4f5c\u6d41\u4e4b\u524d&#xff0c;\u5148\u7406\u6e05 GitHub Actions \u7684\u51e0\u4e2a\u6838\u5fc3\u6982\u5ff5&#xff0c;\u80fd\u5e2e\u4f60\u66f4\u5feb\u5730\u770b\u61c2\u5b98\u65b9\u6587\u6863\u548c\u793e\u533a\u6a21\u677f\u3002<\/p>\n<p>\u5de5\u4f5c\u6d41&#xff08;Workflow&#xff09; \u662f GitHub Actions \u7684\u9876\u5c42\u8c03\u5ea6\u5355\u5143&#xff0c;\u5b9a\u4e49\u5728\u4ed3\u5e93\u7684 .github\/workflows\/ \u76ee\u5f55\u4e0b&#xff0c;\u662f\u4e00\u4e2a YAML \u6587\u4ef6\u3002\u4e00\u4e2a\u4ed3\u5e93\u53ef\u4ee5\u6709\u591a\u4e2a\u5de5\u4f5c\u6d41&#xff0c;\u5404\u81ea\u72ec\u7acb\u89e6\u53d1\u3001\u72ec\u7acb\u8fd0\u884c\u3002<\/p>\n<p>\u4f5c\u4e1a&#xff08;Job&#xff09; \u662f\u5de5\u4f5c\u6d41\u5185\u90e8\u7684\u6267\u884c\u5355\u5143&#xff0c;\u4e00\u4e2a\u5de5\u4f5c\u6d41\u53ef\u4ee5\u5305\u542b\u4e00\u4e2a\u6216\u591a\u4e2a\u4f5c\u4e1a\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u4f5c\u4e1a\u5e76\u884c\u6267\u884c&#xff0c;\u4f46\u4e5f\u53ef\u4ee5\u901a\u8fc7 needs \u5173\u952e\u5b57\u58f0\u660e\u4f9d\u8d56\u5173\u7cfb&#xff0c;\u8ba9\u4f5c\u4e1a\u4e32\u884c\u6216 DAG \u5f0f\u7f16\u6392\u3002\u6bcf\u4e2a\u4f5c\u4e1a\u8fd0\u884c\u5728\u72ec\u7acb\u7684\u865a\u62df\u73af\u5883\u4e2d&#xff08;\u5373 Runner \u4e0a&#xff09;\u3002<\/p>\n<p>\u6b65\u9aa4&#xff08;Step&#xff09; \u662f\u4f5c\u4e1a\u5185\u90e8\u7684\u5177\u4f53\u6267\u884c\u52a8\u4f5c\u3002\u4e00\u4e2a\u6b65\u9aa4\u53ef\u4ee5\u662f\u8fd0\u884c\u4e00\u6761 Shell \u547d\u4ee4&#xff0c;\u4e5f\u53ef\u4ee5\u662f\u8c03\u7528\u4e00\u4e2a\u793e\u533a\u53d1\u5e03\u7684 Action&#xff08;\u4f8b\u5982 actions\/checkout&#064;v4 \u62c9\u53d6\u4ee3\u7801&#xff09;\u3002\u6b65\u9aa4\u5728\u540c\u4e00\u4e2a Runner \u5185\u987a\u5e8f\u6267\u884c&#xff0c;\u53ef\u4ee5\u5171\u4eab\u6587\u4ef6\u7cfb\u7edf\u3002<\/p>\n<p>\u4e8b\u4ef6\u89e6\u53d1\u5668&#xff08;Event&#xff09; \u51b3\u5b9a\u4e86\u5de5\u4f5c\u6d41\u4f55\u65f6\u542f\u52a8\u3002\u5e38\u89c1\u7684\u89e6\u53d1\u5668\u5305\u62ec&#xff1a;<\/p>\n<ul>\n<li>push&#xff1a;\u4ee3\u7801\u63a8\u9001\u5230\u4ed3\u5e93\u65f6\u89e6\u53d1&#xff1b;<\/li>\n<li>pull_request&#xff1a;\u521b\u5efa\u6216\u66f4\u65b0 PR \u65f6\u89e6\u53d1&#xff1b;<\/li>\n<li>schedule&#xff1a;\u6309 Cron \u8868\u8fbe\u5f0f\u5b9a\u65f6\u89e6\u53d1&#xff0c;\u9002\u5408\u5b9a\u65f6\u5de1\u68c0\u7c7b\u4efb\u52a1&#xff1b;<\/li>\n<li>workflow_dispatch&#xff1a;\u5141\u8bb8\u624b\u52a8\u89e6\u53d1&#xff0c;\u652f\u6301\u5728 GitHub Web \u754c\u9762\u4e0a\u8f93\u5165\u53c2\u6570&#xff1b;<\/li>\n<li>release\u3001issues\u3001discussion \u7b49&#xff1a;\u4e0e\u4ed3\u5e93\u5176\u4ed6\u6d3b\u52a8\u6df1\u5ea6\u8054\u52a8\u3002<\/li>\n<\/ul>\n<p>\u8fd0\u884c\u5668&#xff08;Runner&#xff09; \u662f\u5b9e\u9645\u6267\u884c\u4f5c\u4e1a\u7684\u673a\u5668&#xff0c;\u5206\u4e3a\u4e24\u7c7b&#xff1a;<\/p>\n<ul>\n<li>GitHub \u6258\u7ba1\u8fd0\u884c\u5668&#xff1a;\u7531 GitHub \u63d0\u4f9b\u548c\u7ef4\u62a4&#xff0c;\u6309\u5206\u949f\u8ba1\u8d39&#xff08;\u516c\u5f00\u4ed3\u5e93\u514d\u8d39&#xff09;&#xff0c;\u6db5\u76d6 Linux\/macOS\/Windows \u591a\u79cd\u73af\u5883&#xff0c;\u5185\u7f6e\u5e38\u7528\u5de5\u5177\u94fe&#xff0c;\u5f00\u7bb1\u5373\u7528\u3002<\/li>\n<li>\u81ea\u6258\u7ba1\u8fd0\u884c\u5668&#xff1a;\u90e8\u7f72\u5728\u4f60\u81ea\u5df1\u7684\u670d\u52a1\u5668\u4e0a&#xff0c;\u9002\u5408\u9700\u8981\u81ea\u5b9a\u4e49\u786c\u4ef6\u3001\u5185\u7f51\u8bbf\u95ee\u3001\u66f4\u9ad8\u5b89\u5168\u9694\u79bb\u7b49\u573a\u666f&#xff0c;\u5b8c\u5168\u638c\u63a7\u6267\u884c\u73af\u5883\u3002<\/li>\n<\/ul>\n<p>Actions Marketplace \u662f GitHub Actions \u7684\u793e\u533a\u751f\u6001\u4e2d\u5fc3&#xff0c;\u6709\u6570\u4e07\u4e2a\u9884\u6784\u5efa\u7684 Action \u53ef\u76f4\u63a5\u5f15\u7528&#xff0c;\u8986\u76d6\u4ee3\u7801\u68c0\u67e5\u3001\u6d4b\u8bd5\u3001\u6784\u5efa\u3001\u90e8\u7f72\u3001\u901a\u77e5\u3001\u5b89\u5168\u626b\u63cf\u7b49\u51e0\u4e4e\u6240\u6709\u5e38\u89c1\u9700\u6c42\u3002\u5f15\u7528\u65f6\u53ea\u9700\u8981 {owner}\/{repo}&#064;{version} \u5373\u53ef&#xff0c;\u5927\u5e45\u964d\u4f4e\u4e86\u6d41\u6c34\u7ebf\u7f16\u5199\u95e8\u69db\u3002<\/p>\n<p>\u4e0b\u9762\u662f\u4e00\u4e2a\u6700\u5c0f\u7684 Hello World \u5de5\u4f5c\u6d41\u793a\u4f8b&#xff0c;\u5b83\u4f1a\u5728\u6bcf\u6b21 push \u5230 main \u5206\u652f\u65f6\u89e6\u53d1&#xff0c;\u6253\u5370\u4e00\u53e5\u95ee\u5019&#xff1a;<\/p>\n<p><span class=\"token comment\"># .github\/workflows\/hello.yml<\/span><br \/>\n<span class=\"token key atrule\">name<\/span><span class=\"token punctuation\">:<\/span> Hello World<\/p>\n<p><span class=\"token key atrule\">on<\/span><span class=\"token punctuation\">:<\/span><br \/>\n  <span class=\"token key atrule\">push<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token key atrule\">branches<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token punctuation\">[<\/span>main<span class=\"token punctuation\">]<\/span><\/p>\n<p><span class=\"token key atrule\">jobs<\/span><span class=\"token punctuation\">:<\/span><br \/>\n  <span class=\"token key atrule\">greet<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token key atrule\">runs-on<\/span><span class=\"token punctuation\">:<\/span> ubuntu<span class=\"token punctuation\">&#8211;<\/span>latest<br \/>\n    <span class=\"token key atrule\">steps<\/span><span class=\"token punctuation\">:<\/span><br \/>\n      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">name<\/span><span class=\"token punctuation\">:<\/span> Say hello<br \/>\n        <span class=\"token key atrule\">run<\/span><span class=\"token punctuation\">:<\/span> echo &#034;Hello<span class=\"token punctuation\">,<\/span> GitHub Actions<span class=\"token tag\">!<\/span>&#034;<\/p>\n<p>\u628a\u8fd9\u6bb5 YAML \u653e\u5230\u4ed3\u5e93\u7684 .github\/workflows\/hello.yml \u4e2d&#xff0c;\u63a8\u9001\u5230 GitHub&#xff0c;\u4f60\u5c31\u4f1a\u5728 Actions \u6807\u7b7e\u9875\u770b\u5230\u5b83\u7684\u6267\u884c\u7ed3\u679c\u3002\u63a5\u4e0b\u6765\u6211\u4eec\u6df1\u5165\u5de5\u4f5c\u6d41\u8bed\u6cd5&#xff0c;\u8ba9\u4f60\u80fd\u5199\u51fa\u66f4\u590d\u6742\u7684\u7f16\u6392\u903b\u8f91\u3002<\/p>\n<h3>3. \u5de5\u4f5c\u6d41\u8bed\u6cd5\u7cbe\u8bb2\u4e0e\u5b9e\u6218\u6280\u5de7<\/h3>\n<p>\u5de5\u4f5c\u6d41\u7684 YAML \u914d\u7f6e\u770b\u4f3c\u7b80\u5355&#xff0c;\u4f46\u8981\u5199\u51fa\u5065\u58ee\u3001\u53ef\u7ef4\u62a4\u7684\u6d41\u6c34\u7ebf&#xff0c;\u8bed\u6cd5\u7ec6\u8282\u548c\u7f16\u6392\u6280\u5de7\u5fc5\u987b\u638c\u63e1\u3002<\/p>\n<p>YAML \u8bed\u6cd5\u8981\u70b9&#xff1a;GitHub Actions \u7684 YAML \u5bf9\u7f29\u8fdb\u654f\u611f&#xff08;\u5fc5\u987b\u7528\u7a7a\u683c&#xff0c;\u4e0d\u80fd\u7528 Tab&#xff09;&#xff0c;\u591a\u884c\u5b57\u7b26\u4e32\u5efa\u8bae\u7528 |&#xff08;\u4fdd\u7559\u6362\u884c&#xff09;\u6216 &gt;&#xff08;\u6298\u53e0\u4e3a\u4e00\u884c&#xff09;\u3002\u542b\u7279\u6b8a\u5b57\u7b26\u7684\u503c\u9700\u8981\u7528\u5f15\u53f7\u5305\u88f9&#xff0c;\u5c24\u5176\u5728\u4f7f\u7528\u8868\u8fbe\u5f0f ${{ }} \u65f6\u3002<\/p>\n<p>\u6761\u4ef6\u6267\u884c&#xff08;if&#xff09; \u8ba9\u4f60\u6839\u636e\u4e0a\u4e0b\u6587\u51b3\u5b9a\u67d0\u4e2a\u4f5c\u4e1a\u6216\u6b65\u9aa4\u662f\u5426\u8fd0\u884c\u3002\u5e38\u7528\u7684\u6761\u4ef6\u5305\u62ec github.ref&#xff08;\u5f53\u524d\u5206\u652f&#xff09;\u3001github.event_name&#xff08;\u89e6\u53d1\u4e8b\u4ef6\u7c7b\u578b&#xff09;\u3001success()\/failure()&#xff08;\u524d\u7f6e\u6b65\u9aa4\u72b6\u6001&#xff09;\u7b49\u3002\u4f8b\u5982\u4ec5\u5f53\u63a8\u9001\u5230 main \u5206\u652f\u65f6\u624d\u90e8\u7f72&#xff1a;<\/p>\n<p><span class=\"token key atrule\">jobs<\/span><span class=\"token punctuation\">:<\/span><br \/>\n  <span class=\"token key atrule\">deploy<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token key atrule\">if<\/span><span class=\"token punctuation\">:<\/span> github.ref &#061;&#061; &#039;refs\/heads\/main&#039;<br \/>\n    <span class=\"token key atrule\">runs-on<\/span><span class=\"token punctuation\">:<\/span> ubuntu<span class=\"token punctuation\">&#8211;<\/span>latest<br \/>\n    <span class=\"token key atrule\">steps<\/span><span class=\"token punctuation\">:<\/span><br \/>\n      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">run<\/span><span class=\"token punctuation\">:<\/span> echo &#034;Deploying to production<span class=\"token punctuation\">&#8230;<\/span>&#034;<\/p>\n<p>\u4f5c\u4e1a\u4f9d\u8d56&#xff08;needs&#xff09; \u53ef\u4ee5\u58f0\u660e\u4f5c\u4e1a\u95f4\u7684\u6267\u884c\u987a\u5e8f\u3002\u4e00\u4e2a\u5178\u578b\u573a\u666f\u662f&#xff1a;\u5148\u6784\u5efa\u5e76\u6d4b\u8bd5&#xff0c;\u6210\u529f\u540e\u624d\u90e8\u7f72&#xff1a;<\/p>\n<p><span class=\"token key atrule\">jobs<\/span><span class=\"token punctuation\">:<\/span><br \/>\n  <span class=\"token key atrule\">build<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token key atrule\">runs-on<\/span><span class=\"token punctuation\">:<\/span> ubuntu<span class=\"token punctuation\">&#8211;<\/span>latest<br \/>\n    <span class=\"token key atrule\">steps<\/span><span class=\"token punctuation\">:<\/span><br \/>\n      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">run<\/span><span class=\"token punctuation\">:<\/span> echo &#034;Building<span class=\"token punctuation\">&#8230;<\/span>&#034;<br \/>\n  <span class=\"token key atrule\">test<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token key atrule\">needs<\/span><span class=\"token punctuation\">:<\/span> build<br \/>\n    <span class=\"token key atrule\">runs-on<\/span><span class=\"token punctuation\">:<\/span> ubuntu<span class=\"token punctuation\">&#8211;<\/span>latest<br \/>\n    <span class=\"token key atrule\">steps<\/span><span class=\"token punctuation\">:<\/span><br \/>\n      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">run<\/span><span class=\"token punctuation\">:<\/span> echo &#034;Testing<span class=\"token punctuation\">&#8230;<\/span>&#034;<br \/>\n  <span class=\"token key atrule\">deploy<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token key atrule\">needs<\/span><span class=\"token punctuation\">:<\/span> test<br \/>\n    <span class=\"token key atrule\">runs-on<\/span><span class=\"token punctuation\">:<\/span> ubuntu<span class=\"token punctuation\">&#8211;<\/span>latest<br \/>\n    <span class=\"token key atrule\">steps<\/span><span class=\"token punctuation\">:<\/span><br \/>\n      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">run<\/span><span class=\"token punctuation\">:<\/span> echo &#034;Deploying<span class=\"token punctuation\">&#8230;<\/span>&#034;<\/p>\n<p>\u73af\u5883\u53d8\u91cf\u4e0e\u5bc6\u94a5\u7ba1\u7406&#xff1a;\u73af\u5883\u53d8\u91cf\u53ef\u4ee5\u5728 env \u5b57\u6bb5\u4e2d\u58f0\u660e&#xff08;\u4f5c\u4e1a\u7ea7\u6216\u6b65\u9aa4\u7ea7\u5747\u53ef&#xff09;&#xff0c;\u800c\u654f\u611f\u4fe1\u606f&#xff08;\u5982 Token\u3001\u5bc6\u7801&#xff09;\u52a1\u5fc5\u901a\u8fc7 Secrets \u7ba1\u7406&#xff0c;\u5728\u5de5\u4f5c\u6d41\u4e2d\u901a\u8fc7 ${{ secrets.XXX }} \u5f15\u7528\u3002GitHub \u8fd8\u652f\u6301 vars&#xff08;\u975e\u654f\u611f\u914d\u7f6e\u53d8\u91cf&#xff09;&#xff0c;\u65b9\u4fbf\u5b58\u653e\u73af\u5883\u540d\u79f0\u3001API \u7aef\u70b9\u7b49\u3002<\/p>\n<p><span class=\"token key atrule\">jobs<\/span><span class=\"token punctuation\">:<\/span><br \/>\n  <span class=\"token key atrule\">build<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token key atrule\">runs-on<\/span><span class=\"token punctuation\">:<\/span> ubuntu<span class=\"token punctuation\">&#8211;<\/span>latest<br \/>\n    <span class=\"token key atrule\">env<\/span><span class=\"token punctuation\">:<\/span><br \/>\n      <span class=\"token key atrule\">NODE_ENV<\/span><span class=\"token punctuation\">:<\/span> production<br \/>\n    <span class=\"token key atrule\">steps<\/span><span class=\"token punctuation\">:<\/span><br \/>\n      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">run<\/span><span class=\"token punctuation\">:<\/span> echo &#034;Deploying to $<span class=\"token punctuation\">{<\/span><span class=\"token punctuation\">{<\/span> vars.ENDPOINT <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">}<\/span> with token $<span class=\"token punctuation\">{<\/span><span class=\"token punctuation\">{<\/span> secrets.DEPLOY_TOKEN <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">}<\/span>&#034;<\/p>\n<p>\u77e9\u9635\u7b56\u7565&#xff08;matrix&#xff09; \u662f\u5e76\u884c\u6784\u5efa\u7684\u5229\u5668\u3002\u4f60\u53ef\u4ee5\u5728\u4e00\u4e2a\u4f5c\u4e1a\u5b9a\u4e49\u91cc\u58f0\u660e\u4e00\u7ec4\u53d8\u91cf\u7ec4\u5408&#xff0c;GitHub Actions \u4f1a\u4e3a\u6bcf\u4e2a\u7ec4\u5408\u751f\u6210\u4e00\u4e2a\u72ec\u7acb\u7684\u4f5c\u4e1a\u5b9e\u4f8b\u5e76\u884c\u8fd0\u884c&#xff1a;<\/p>\n<p><span class=\"token key atrule\">jobs<\/span><span class=\"token punctuation\">:<\/span><br \/>\n  <span class=\"token key atrule\">test<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token key atrule\">strategy<\/span><span class=\"token punctuation\">:<\/span><br \/>\n      <span class=\"token key atrule\">matrix<\/span><span class=\"token punctuation\">:<\/span><br \/>\n        <span class=\"token key atrule\">node-version<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token number\">18<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">20<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">22<\/span><span class=\"token punctuation\">]<\/span><br \/>\n        <span class=\"token key atrule\">os<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token punctuation\">[<\/span>ubuntu<span class=\"token punctuation\">&#8211;<\/span>latest<span class=\"token punctuation\">,<\/span> windows<span class=\"token punctuation\">&#8211;<\/span>latest<span class=\"token punctuation\">]<\/span><br \/>\n    <span class=\"token key atrule\">runs-on<\/span><span class=\"token punctuation\">:<\/span> $<span class=\"token punctuation\">{<\/span><span class=\"token punctuation\">{<\/span> matrix.os <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">}<\/span><br \/>\n    <span class=\"token key atrule\">steps<\/span><span class=\"token punctuation\">:<\/span><br \/>\n      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">uses<\/span><span class=\"token punctuation\">:<\/span> actions\/setup<span class=\"token punctuation\">&#8211;<\/span>node&#064;v4<br \/>\n        <span class=\"token key atrule\">with<\/span><span class=\"token punctuation\">:<\/span><br \/>\n          <span class=\"token key atrule\">node-version<\/span><span class=\"token punctuation\">:<\/span> $<span class=\"token punctuation\">{<\/span><span class=\"token punctuation\">{<\/span> matrix.node<span class=\"token punctuation\">&#8211;<\/span>version <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">}<\/span><br \/>\n      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">run<\/span><span class=\"token punctuation\">:<\/span> npm test<\/p>\n<p>\u7f13\u5b58\u4e0e\u5de5\u4ef6&#xff1a;\u7f13\u5b58&#xff08;cache&#xff09;\u7528\u4e8e\u6301\u4e45\u5316\u4f9d\u8d56&#xff08;\u5982 node_modules\u3001.m2&#xff09;&#xff0c;\u51cf\u5c11\u91cd\u590d\u4e0b\u8f7d&#xff0c;\u52a0\u901f\u6d41\u6c34\u7ebf\u3002\u5de5\u4ef6&#xff08;artifact&#xff09;\u7528\u4e8e\u5728\u4f5c\u4e1a\u4e4b\u95f4\u4f20\u9012\u6784\u5efa\u4ea7\u7269&#xff08;\u5982\u7f16\u8bd1\u540e\u7684\u4e8c\u8fdb\u5236\u3001\u6d4b\u8bd5\u62a5\u544a&#xff09;&#xff0c;\u901a\u8fc7 actions\/upload-artifact \u548c actions\/download-artifact \u64cd\u4f5c\u5b9e\u73b0\u3002<\/p>\n<p>\u4e0a\u4e0b\u6587\u4e0e\u8868\u8fbe\u5f0f&#xff1a;${{ }} \u662f GitHub Actions \u7684\u8868\u8fbe\u5f0f\u8bed\u6cd5&#xff0c;\u53ef\u4ee5\u5728\u5176\u4e2d\u8bbf\u95ee\u4e30\u5bcc\u7684\u4e0a\u4e0b\u6587\u5bf9\u8c61&#xff0c;\u5305\u62ec github&#xff08;\u4ed3\u5e93\u3001PR\u3001\u4e8b\u4ef6\u4fe1\u606f&#xff09;\u3001env&#xff08;\u73af\u5883\u53d8\u91cf&#xff09;\u3001job&#xff08;\u5f53\u524d\u4f5c\u4e1a\u72b6\u6001&#xff09;\u3001matrix&#xff08;\u5f53\u524d\u77e9\u9635\u7ec4\u5408&#xff09;\u7b49\u3002\u8868\u8fbe\u5f0f\u652f\u6301\u903b\u8f91\u8fd0\u7b97\u3001\u5b57\u7b26\u4e32\u51fd\u6570\u3001JSON \u89e3\u6790\u7b49&#xff0c;\u8ba9\u4f60\u7075\u6d3b\u63a7\u5236\u6d41\u7a0b\u3002<\/p>\n<p>\u638c\u63e1\u4e86\u8fd9\u4e9b\u8bed\u6cd5\u57fa\u7840&#xff0c;\u4f60\u5c31\u53ef\u4ee5\u5f00\u59cb\u7f16\u5199\u771f\u6b63\u5b9e\u7528\u7684 CI\/CD \u6d41\u6c34\u7ebf\u4e86\u3002\u4e0b\u4e00\u7ae0\u6211\u4eec\u5c06\u8fdb\u5165\u591a\u573a\u666f\u5b9e\u6218\u3002<\/p>\n<h3>4. CI\/CD \u5b9e\u6218&#xff1a;\u6784\u5efa\u3001\u6d4b\u8bd5\u4e0e\u90e8\u7f72\u4e00\u6761\u9f99<\/h3>\n<p>\u7406\u8bba\u8bb2\u5b8c&#xff0c;\u8be5\u52a8\u624b\u4e86\u3002\u672c\u7ae0\u6db5\u76d6\u56db\u4e2a\u5178\u578b\u573a\u666f&#xff0c;\u4ece\u8bed\u8a00\u6808\u7684\u6784\u5efa\u6d4b\u8bd5\u5230 Kubernetes \u90e8\u7f72&#xff0c;\u4f60\u53ef\u4ee5\u6309\u9700\u53d6\u7528\u3002<\/p>\n<p>\u573a\u666f\u4e00&#xff1a;Node.js \/ Python \/ Java \u9879\u76ee\u7684\u81ea\u52a8\u6784\u5efa\u4e0e\u6d4b\u8bd5<\/p>\n<p>\u4ee5 Node.js \u9879\u76ee\u4e3a\u4f8b&#xff0c;\u4e0b\u9762\u8fd9\u4e2a\u5de5\u4f5c\u6d41\u5728\u6bcf\u6b21 PR \u5230 main \u5206\u652f\u65f6&#xff0c;\u7528\u4e09\u4e2a Node \u7248\u672c\u5e76\u884c\u8fd0\u884c\u6d4b\u8bd5&#xff1a;<\/p>\n<p><span class=\"token key atrule\">name<\/span><span class=\"token punctuation\">:<\/span> Node.js CI<\/p>\n<p><span class=\"token key atrule\">on<\/span><span class=\"token punctuation\">:<\/span><br \/>\n  <span class=\"token key atrule\">pull_request<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token key atrule\">branches<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token punctuation\">[<\/span>main<span class=\"token punctuation\">]<\/span><\/p>\n<p><span class=\"token key atrule\">jobs<\/span><span class=\"token punctuation\">:<\/span><br \/>\n  <span class=\"token key atrule\">test<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token key atrule\">strategy<\/span><span class=\"token punctuation\">:<\/span><br \/>\n      <span class=\"token key atrule\">matrix<\/span><span class=\"token punctuation\">:<\/span><br \/>\n        <span class=\"token key atrule\">node-version<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token number\">18<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">20<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">22<\/span><span class=\"token punctuation\">]<\/span><br \/>\n    <span class=\"token key atrule\">runs-on<\/span><span class=\"token punctuation\">:<\/span> ubuntu<span class=\"token punctuation\">&#8211;<\/span>latest<br \/>\n    <span class=\"token key atrule\">steps<\/span><span class=\"token punctuation\">:<\/span><br \/>\n      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">uses<\/span><span class=\"token punctuation\">:<\/span> actions\/checkout&#064;v4<br \/>\n      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">uses<\/span><span class=\"token punctuation\">:<\/span> actions\/setup<span class=\"token punctuation\">&#8211;<\/span>node&#064;v4<br \/>\n        <span class=\"token key atrule\">with<\/span><span class=\"token punctuation\">:<\/span><br \/>\n          <span class=\"token key atrule\">node-version<\/span><span class=\"token punctuation\">:<\/span> $<span class=\"token punctuation\">{<\/span><span class=\"token punctuation\">{<\/span> matrix.node<span class=\"token punctuation\">&#8211;<\/span>version <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">}<\/span><br \/>\n          <span class=\"token key atrule\">cache<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">&#039;npm&#039;<\/span><br \/>\n      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">run<\/span><span class=\"token punctuation\">:<\/span> npm ci<br \/>\n      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">run<\/span><span class=\"token punctuation\">:<\/span> npm test<\/p>\n<p>Python \u6216 Java \u9879\u76ee\u540c\u7406&#xff0c;\u53ea\u9700\u5c06 setup-node \u66ff\u6362\u4e3a setup-python \u6216 setup-java&#xff0c;\u518d\u8c03\u6574\u5bf9\u5e94\u7684\u5305\u7ba1\u7406\u548c\u6d4b\u8bd5\u547d\u4ee4\u5373\u53ef\u3002<\/p>\n<p>\u573a\u666f\u4e8c&#xff1a;\u591a\u73af\u5883\u90e8\u7f72&#xff08;\u5f00\u53d1\/\u9884\u53d1\/\u751f\u4ea7&#xff09;<\/p>\n<p>\u4f7f\u7528\u73af\u5883&#xff08;Environment&#xff09;\u529f\u80fd\u53ef\u4ee5\u4e3a\u4e0d\u540c\u90e8\u7f72\u76ee\u6807\u914d\u7f6e\u4e0d\u540c\u7684 Secrets \u548c protection rules&#xff08;\u5982\u5ba1\u6279\u6d41\u7a0b&#xff09;\u3002\u4e0b\u9762\u5c55\u793a\u5982\u4f55\u901a\u8fc7 environment \u5b57\u6bb5\u5206\u522b\u90e8\u7f72\u5230 dev \u548c prod&#xff1a;<\/p>\n<p><span class=\"token key atrule\">jobs<\/span><span class=\"token punctuation\">:<\/span><br \/>\n  <span class=\"token key atrule\">deploy-dev<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token key atrule\">runs-on<\/span><span class=\"token punctuation\">:<\/span> ubuntu<span class=\"token punctuation\">&#8211;<\/span>latest<br \/>\n    <span class=\"token key atrule\">environment<\/span><span class=\"token punctuation\">:<\/span> development<br \/>\n    <span class=\"token key atrule\">steps<\/span><span class=\"token punctuation\">:<\/span><br \/>\n      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">run<\/span><span class=\"token punctuation\">:<\/span> echo &#034;Deploying to dev<span class=\"token punctuation\">&#8230;<\/span>&#034;<br \/>\n  <span class=\"token key atrule\">deploy-prod<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token key atrule\">needs<\/span><span class=\"token punctuation\">:<\/span> deploy<span class=\"token punctuation\">&#8211;<\/span>dev<br \/>\n    <span class=\"token key atrule\">runs-on<\/span><span class=\"token punctuation\">:<\/span> ubuntu<span class=\"token punctuation\">&#8211;<\/span>latest<br \/>\n    <span class=\"token key atrule\">environment<\/span><span class=\"token punctuation\">:<\/span> production<br \/>\n    <span class=\"token key atrule\">steps<\/span><span class=\"token punctuation\">:<\/span><br \/>\n      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">run<\/span><span class=\"token punctuation\">:<\/span> echo &#034;Deploying to production<span class=\"token punctuation\">&#8230;<\/span>&#034;<\/p>\n<p>\u573a\u666f\u4e09&#xff1a;Docker \u955c\u50cf\u81ea\u52a8\u6784\u5efa\u5e76\u63a8\u9001<\/p>\n<p>\u7ed3\u5408 docker\/build-push-action&#xff0c;\u53ef\u4ee5\u8f7b\u677e\u5b9e\u73b0\u81ea\u52a8\u6784\u5efa\u5e76\u63a8\u9001\u5230 Docker Hub \u6216 GitHub Container Registry&#xff08;GHCR&#xff09;&#xff1a;<\/p>\n<p><span class=\"token key atrule\">jobs<\/span><span class=\"token punctuation\">:<\/span><br \/>\n  <span class=\"token key atrule\">docker<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token key atrule\">runs-on<\/span><span class=\"token punctuation\">:<\/span> ubuntu<span class=\"token punctuation\">&#8211;<\/span>latest<br \/>\n    <span class=\"token key atrule\">steps<\/span><span class=\"token punctuation\">:<\/span><br \/>\n      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">uses<\/span><span class=\"token punctuation\">:<\/span> actions\/checkout&#064;v4<br \/>\n      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">uses<\/span><span class=\"token punctuation\">:<\/span> docker\/login<span class=\"token punctuation\">&#8211;<\/span>action&#064;v3<br \/>\n        <span class=\"token key atrule\">with<\/span><span class=\"token punctuation\">:<\/span><br \/>\n          <span class=\"token key atrule\">registry<\/span><span class=\"token punctuation\">:<\/span> ghcr.io<br \/>\n          <span class=\"token key atrule\">username<\/span><span class=\"token punctuation\">:<\/span> $<span class=\"token punctuation\">{<\/span><span class=\"token punctuation\">{<\/span> github.actor <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">}<\/span><br \/>\n          <span class=\"token key atrule\">password<\/span><span class=\"token punctuation\">:<\/span> $<span class=\"token punctuation\">{<\/span><span class=\"token punctuation\">{<\/span> secrets.GITHUB_TOKEN <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">}<\/span><br \/>\n      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">uses<\/span><span class=\"token punctuation\">:<\/span> docker\/build<span class=\"token punctuation\">&#8211;<\/span>push<span class=\"token punctuation\">&#8211;<\/span>action&#064;v5<br \/>\n        <span class=\"token key atrule\">with<\/span><span class=\"token punctuation\">:<\/span><br \/>\n          <span class=\"token key atrule\">push<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token boolean important\">true<\/span><br \/>\n          <span class=\"token key atrule\">tags<\/span><span class=\"token punctuation\">:<\/span> ghcr.io\/$<span class=\"token punctuation\">{<\/span><span class=\"token punctuation\">{<\/span> github.repository <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">}<\/span>\/my<span class=\"token punctuation\">&#8211;<\/span>app<span class=\"token punctuation\">:<\/span>latest<\/p>\n<p>\u573a\u666f\u56db&#xff1a;Kubernetes \u81ea\u52a8\u90e8\u7f72&#xff08;\u7ed3\u5408 Helm \/ Kustomize&#xff09;<\/p>\n<p>\u90e8\u7f72\u5230 Kubernetes \u96c6\u7fa4\u65f6&#xff0c;\u53ef\u4ee5\u5728 GitHub Actions \u4e2d\u914d\u7f6e kubeconfig&#xff0c;\u901a\u8fc7 helm upgrade \u6216 kubectl apply \u5b8c\u6210\u66f4\u65b0\u3002\u7ed3\u5408 OIDC \u514d\u5bc6\u94a5\u8ba4\u8bc1\u53ef\u4ee5\u907f\u514d\u5728 Secrets \u4e2d\u5b58\u653e\u957f\u671f\u51ed\u8bc1&#xff0c;\u5927\u5e45\u63d0\u5347\u5b89\u5168\u6027\u3002<\/p>\n<p>\u84dd\u7eff\u90e8\u7f72\u4e0e\u6eda\u52a8\u66f4\u65b0<\/p>\n<p>\u5de5\u4f5c\u6d41\u672c\u8eab\u4e0d\u63d0\u4f9b\u539f\u751f\u90e8\u7f72\u7b56\u7565&#xff0c;\u4f46\u4f60\u53ef\u4ee5\u901a\u8fc7\u903b\u8f91\u7f16\u6392\u6765\u5b9e\u73b0&#xff1a;<\/p>\n<ul>\n<li>\u84dd\u7eff\u90e8\u7f72&#xff1a;\u51c6\u5907\u4e24\u5957\u73af\u5883&#xff0c;\u90e8\u7f72\u5230\u975e\u6d3b\u8dc3\u73af\u5883&#xff0c;\u9a8c\u8bc1\u540e\u5207\u6362\u6d41\u91cf\u3002<\/li>\n<li>\u6eda\u52a8\u66f4\u65b0&#xff1a;\u5229\u7528 Kubernetes \u7684\u539f\u751f\u6eda\u52a8\u66f4\u65b0\u80fd\u529b&#xff0c;\u8bbe\u7f6e strategy.rollingUpdate \u53c2\u6570&#xff0c;\u914d\u5408\u5de5\u4f5c\u6d41\u4e2d\u7684 kubectl rollout status \u547d\u4ee4\u89c2\u5bdf\u90e8\u7f72\u8fdb\u5ea6\u3002<\/li>\n<\/ul>\n<p>\u8fd9\u4e9b\u573a\u666f\u8986\u76d6\u4e86\u4ece\u4ee3\u7801\u63d0\u4ea4\u5230\u7ebf\u4e0a\u8fd0\u884c\u7684\u5b8c\u6574\u94fe\u8def&#xff0c;\u5b9e\u9645\u9879\u76ee\u4e2d\u53ef\u4ee5\u6839\u636e\u56e2\u961f\u89c4\u6a21\u548c\u5b89\u5168\u8981\u6c42\u88c1\u526a\u7ec4\u5408\u3002<\/p>\n<h3>5. \u81ea\u52a8\u5316\u8fd0\u7ef4\u5b9e\u6218&#xff08;IaC &#043; \u811a\u672c\u5316\u8fd0\u7ef4&#xff09;<\/h3>\n<p>GitHub Actions \u4e0d\u4ec5\u662f CI\/CD \u5de5\u5177&#xff0c;\u66f4\u662f\u81ea\u52a8\u5316\u8fd0\u7ef4\u7684\u7f16\u6392\u5f15\u64ce\u3002\u4ee5\u4e0b\u4e94\u4e2a\u5b9e\u6218\u65b9\u5411&#xff0c;\u8ba9\u8fd0\u7ef4\u5de5\u4f5c\u4ece\u201c\u4eba\u8089\u64cd\u4f5c\u201d\u8f6c\u5411\u201c\u4e8b\u4ef6\u9a71\u52a8\u201d\u3002<\/p>\n<p>\u96c6\u6210 Terraform \/ Pulumi \u5b9e\u73b0 IaC \u81ea\u52a8\u7f16\u6392<\/p>\n<p>\u5c06\u57fa\u7840\u8bbe\u65bd\u5373\u4ee3\u7801&#xff08;IaC&#xff09;\u5de5\u5177\u96c6\u6210\u5230\u5de5\u4f5c\u6d41\u4e2d&#xff0c;\u5b9e\u73b0\u57fa\u7840\u8bbe\u65bd\u7684\u58f0\u660e\u5f0f\u7ba1\u7406\u3002\u4ee5 Terraform \u4e3a\u4f8b&#xff1a;<\/p>\n<p><span class=\"token key atrule\">jobs<\/span><span class=\"token punctuation\">:<\/span><br \/>\n  <span class=\"token key atrule\">terraform<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token key atrule\">runs-on<\/span><span class=\"token punctuation\">:<\/span> ubuntu<span class=\"token punctuation\">&#8211;<\/span>latest<br \/>\n    <span class=\"token key atrule\">steps<\/span><span class=\"token punctuation\">:<\/span><br \/>\n      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">uses<\/span><span class=\"token punctuation\">:<\/span> actions\/checkout&#064;v4<br \/>\n      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">uses<\/span><span class=\"token punctuation\">:<\/span> hashicorp\/setup<span class=\"token punctuation\">&#8211;<\/span>terraform&#064;v3<br \/>\n      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">run<\/span><span class=\"token punctuation\">:<\/span> terraform init<br \/>\n      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">run<\/span><span class=\"token punctuation\">:<\/span> terraform plan<br \/>\n      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">run<\/span><span class=\"token punctuation\">:<\/span> terraform apply <span class=\"token punctuation\">&#8211;<\/span>auto<span class=\"token punctuation\">&#8211;<\/span>approve<\/p>\n<p>Pulumi \u540c\u7406&#xff0c;\u7528 pulumi\/actions&#064;v4 \u5373\u53ef\u3002IaC \u5de5\u4f5c\u6d41\u901a\u5e38\u914d\u5408 PR \u6d41\u7a0b&#xff1a;PR \u521b\u5efa\u65f6\u6267\u884c plan \u5e76\u8bc4\u8bba\u5230 PR \u4e2d&#xff0c;\u5408\u5e76\u5230 main \u65f6\u81ea\u52a8 apply&#xff0c;\u5f62\u6210\u4e00\u6761\u5b8c\u6574\u7684 GitOps \u94fe\u8def\u3002<\/p>\n<p>\u5229\u7528 GitHub Actions \u6267\u884c Ansible Playbook<\/p>\n<p>\u5982\u679c\u56e2\u961f\u5df2\u7ecf\u6709 Ansible \u5267\u672c\u79ef\u7d2f&#xff0c;\u53ef\u4ee5\u628a\u5b83\u4eec\u642c\u5230 Actions \u91cc\u6267\u884c\u3002\u5173\u952e\u5728\u4e8e Runner \u9700\u8981\u80fd SSH \u5230\u76ee\u6807\u673a\u5668&#xff0c;\u63a8\u8350\u4f7f\u7528\u81ea\u6258\u7ba1 Runner \u90e8\u7f72\u5728\u5185\u7f51\u73af\u5883&#xff0c;\u6216\u5c06 SSH \u79c1\u94a5\u5b58\u5165 Secrets \u4f9b GitHub \u6258\u7ba1 Runner \u4f7f\u7528&#xff1a;<\/p>\n<p><span class=\"token key atrule\">steps<\/span><span class=\"token punctuation\">:<\/span><br \/>\n  <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">uses<\/span><span class=\"token punctuation\">:<\/span> actions\/checkout&#064;v4<br \/>\n  <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">run<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token punctuation\">|<\/span><span class=\"token scalar string\"><br \/>\n      mkdir -p ~\/.ssh<br \/>\n      echo &#034;${{ secrets.SSH_PRIVATE_KEY }}&#034; &gt; ~\/.ssh\/id_rsa<br \/>\n      chmod 600 ~\/.ssh\/id_rsa<\/span><br \/>\n  <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">run<\/span><span class=\"token punctuation\">:<\/span> ansible<span class=\"token punctuation\">&#8211;<\/span>playbook <span class=\"token punctuation\">&#8211;<\/span>i inventory playbook.yml<\/p>\n<p>\u5b9a\u65f6\u5de1\u68c0\u4e0e\u5065\u5eb7\u68c0\u67e5<\/p>\n<p>\u5229\u7528 schedule \u89e6\u53d1\u5668&#xff0c;\u53ef\u4ee5\u8f7b\u677e\u5b9e\u73b0\u5b9a\u65f6\u5de1\u68c0\u4efb\u52a1\u3002\u4f8b\u5982\u6bcf 30 \u5206\u949f\u5bf9\u6838\u5fc3 API \u505a\u4e00\u6b21\u5065\u5eb7\u68c0\u67e5&#xff0c;\u5f02\u5e38\u65f6\u901a\u8fc7 Actions \u7684 Job \u5931\u8d25\u901a\u77e5\u673a\u5236\u544a\u8b66&#xff1a;<\/p>\n<p><span class=\"token key atrule\">on<\/span><span class=\"token punctuation\">:<\/span><br \/>\n  <span class=\"token key atrule\">schedule<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">cron<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">&#039;*\/30 * * * *&#039;<\/span><br \/>\n<span class=\"token key atrule\">jobs<\/span><span class=\"token punctuation\">:<\/span><br \/>\n  <span class=\"token key atrule\">health-check<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token key atrule\">runs-on<\/span><span class=\"token punctuation\">:<\/span> ubuntu<span class=\"token punctuation\">&#8211;<\/span>latest<br \/>\n    <span class=\"token key atrule\">steps<\/span><span class=\"token punctuation\">:<\/span><br \/>\n      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">run<\/span><span class=\"token punctuation\">:<\/span> curl <span class=\"token punctuation\">&#8211;<\/span>f https<span class=\"token punctuation\">:<\/span>\/\/api.example.com\/health <span class=\"token punctuation\">|<\/span><span class=\"token punctuation\">|<\/span> exit 1<\/p>\n<p>\u81ea\u52a8\u6e05\u7406\u8fc7\u671f\u8d44\u6e90<\/p>\n<p>\u4e91\u8d44\u6e90\u7684\u201c\u50f5\u5c38\u201d\u5b9e\u4f8b\u3001\u65e7\u955c\u50cf\u3001\u8fc7\u671f\u65e5\u5fd7\u662f\u8fd0\u7ef4\u7684\u5e38\u89c1\u75db\u70b9\u3002\u53ef\u4ee5\u7f16\u5199\u4e00\u4e2a\u5b9a\u65f6\u5de5\u4f5c\u6d41&#xff0c;\u8c03\u7528\u4e91\u5382\u5546 CLI \u6e05\u7406\u6307\u5b9a\u6807\u7b7e\u6216\u8d85\u8fc7 N \u5929\u7684\u8d44\u6e90&#xff1a;<\/p>\n<ul>\n<li>\u6e05\u7406\u8d85\u8fc7 7 \u5929\u7684 Docker \u65e7\u955c\u50cf&#xff08;docker image prune&#xff09;&#xff1b;<\/li>\n<li>\u91ca\u653e\u5e26\u6709 AutoCleanup&#061;true \u6807\u7b7e\u7684\u4e91\u4e3b\u673a&#xff1b;<\/li>\n<li>\u65cb\u8f6c\u8d85\u8fc7 30 \u5929\u7684\u65e5\u5fd7\u6587\u4ef6\u3002<\/li>\n<\/ul>\n<p>\u6570\u636e\u5e93\u53d8\u66f4\u81ea\u52a8\u5316&#xff08;Flyway \/ Liquibase \u96c6\u6210&#xff09;<\/p>\n<p>\u5c06\u6570\u636e\u5e93\u8fc1\u79fb\u811a\u672c\u7eb3\u5165\u7248\u672c\u63a7\u5236&#xff0c;\u901a\u8fc7 GitHub Actions \u5728\u90e8\u7f72\u65f6\u81ea\u52a8\u6267\u884c Flyway \u6216 Liquibase&#xff0c;\u5b9e\u73b0\u6570\u636e\u5e93\u53d8\u66f4\u4e0e\u4ee3\u7801\u53d1\u5e03\u540c\u6b65&#xff1a;<\/p>\n<p><span class=\"token key atrule\">steps<\/span><span class=\"token punctuation\">:<\/span><br \/>\n  <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">uses<\/span><span class=\"token punctuation\">:<\/span> actions\/checkout&#064;v4<br \/>\n  <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">run<\/span><span class=\"token punctuation\">:<\/span> flyway migrate <span class=\"token punctuation\">&#8211;<\/span>url&#061;$<span class=\"token punctuation\">{<\/span><span class=\"token punctuation\">{<\/span> secrets.DB_URL <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">}<\/span> <span class=\"token punctuation\">&#8211;<\/span>user&#061;$<span class=\"token punctuation\">{<\/span><span class=\"token punctuation\">{<\/span> secrets.DB_USER <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">}<\/span> <span class=\"token punctuation\">&#8211;<\/span>password&#061;$<span class=\"token punctuation\">{<\/span><span class=\"token punctuation\">{<\/span> secrets.DB_PASSWORD <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">}<\/span><\/p>\n<p>\u4ee5\u4e0a\u4e94\u4e2a\u65b9\u5411\u8986\u76d6\u4e86 IaC\u3001\u914d\u7f6e\u7ba1\u7406\u3001\u76d1\u63a7\u5de1\u68c0\u3001\u8d44\u6e90\u6e05\u7406\u548c\u6570\u636e\u5e93\u8fd0\u7ef4&#xff0c;\u4f60\u53ef\u4ee5\u6839\u636e\u56e2\u961f\u7684\u5b9e\u9645\u75db\u70b9\u9010\u6b65\u5f15\u5165&#xff0c;\u8ba9\u8fd0\u7ef4\u5de5\u4f5c\u8d8a\u6765\u8d8a\u201c\u7701\u5fc3\u201d\u3002<\/p>\n<h3>6. \u81ea\u6258\u7ba1\u8fd0\u884c\u5668\u4e0e\u4f01\u4e1a\u7ea7\u5b89\u5168\u5b9e\u8df5<\/h3>\n<p>\u5f53\u9879\u76ee\u89c4\u6a21\u589e\u957f&#xff0c;\u6216\u8005\u5bf9\u5b89\u5168\u6709\u4e25\u683c\u8981\u6c42\u65f6&#xff0c;GitHub \u6258\u7ba1\u7684\u8fd0\u884c\u5668\u53ef\u80fd\u6ee1\u8db3\u4e0d\u4e86\u9700\u6c42\u3002\u672c\u7ae0\u805a\u7126\u81ea\u6258\u7ba1 Runner \u7684\u90e8\u7f72\u4e0e\u5b89\u5168\u52a0\u56fa&#xff0c;\u4ee5\u53ca\u4f01\u4e1a\u7ea7\u7684\u51ed\u8bc1\u7ba1\u7406\u548c\u4f9b\u5e94\u94fe\u5b89\u5168\u3002<\/p>\n<p>\u81ea\u6258\u7ba1 Runner \u7684\u90e8\u7f72\u4e0e\u914d\u7f6e<\/p>\n<p>\u81ea\u6258\u7ba1 Runner \u53ef\u4ee5\u90e8\u7f72\u5728 Linux\u3001Windows \u6216 macOS \u4e0a\u3002\u4ee5 Linux \u4e3a\u4f8b&#xff0c;\u5728\u4ed3\u5e93\u7684 Settings \u2192 Actions \u2192 Runners \u4e2d\u70b9\u51fb\u201cNew self-hosted runner\u201d&#xff0c;\u6309\u6307\u5f15\u6267\u884c&#xff1a;<\/p>\n<p><span class=\"token comment\"># \u4e0b\u8f7d\u5e76\u914d\u7f6e Runner<\/span><br \/>\n<span class=\"token function\">mkdir<\/span> actions-runner <span class=\"token operator\">&amp;&amp;<\/span> <span class=\"token builtin class-name\">cd<\/span> actions-runner<br \/>\n<span class=\"token function\">curl<\/span> <span class=\"token parameter variable\">-o<\/span> actions-runner-linux-x64.tar.gz <span class=\"token parameter variable\">-L<\/span> <span class=\"token operator\">&lt;<\/span>\u4e0b\u8f7d\u94fe\u63a5<span class=\"token operator\">&gt;<\/span><br \/>\n<span class=\"token function\">tar<\/span> xzf .\/actions-runner-linux-x64.tar.gz<br \/>\n.\/config.sh <span class=\"token parameter variable\">&#8211;url<\/span> https:\/\/github.com\/<span class=\"token operator\">&lt;<\/span>owner<span class=\"token operator\">&gt;<\/span>\/<span class=\"token operator\">&lt;<\/span>repo<span class=\"token operator\">&gt;<\/span> <span class=\"token parameter variable\">&#8211;token<\/span> <span class=\"token operator\">&lt;<\/span>token<span class=\"token operator\">&gt;<\/span><br \/>\n.\/run.sh<\/p>\n<p>\u751f\u4ea7\u73af\u5883\u5efa\u8bae\u5c06 Runner \u6ce8\u518c\u4e3a\u7cfb\u7edf\u670d\u52a1&#xff08;sudo .\/svc.sh install&#xff09;&#xff0c;\u5e76\u914d\u7f6e\u6210 systemd \u81ea\u542f\u52a8&#xff0c;\u786e\u4fdd\u673a\u5668\u91cd\u542f\u540e Runner \u81ea\u52a8\u6062\u590d\u3002<\/p>\n<p>Runner \u7684\u5b89\u5168\u52a0\u56fa\u4e0e\u7f51\u7edc\u9694\u79bb<\/p>\n<p>\u81ea\u6258\u7ba1 Runner \u76f4\u63a5\u8dd1\u5728\u4f60\u7684\u670d\u52a1\u5668\u4e0a&#xff0c;\u5b89\u5168\u4e0d\u5bb9\u5ffd\u89c6&#xff1a;<\/p>\n<ul>\n<li>\u4e13\u7528 Runner \u6c60&#xff1a;\u4e3a\u654f\u611f\u4ed3\u5e93\u914d\u7f6e\u72ec\u7acb\u7684 Runner&#xff0c;\u907f\u514d\u4e0e\u5176\u5b83\u9879\u76ee\u6df7\u7528\u3002<\/li>\n<li>\u7f51\u7edc\u9694\u79bb&#xff1a;\u5c06 Runner \u90e8\u7f72\u5728 VPC \/ \u5185\u7f51\u73af\u5883&#xff0c;\u4ec5\u5f00\u653e\u5fc5\u8981\u7684\u51fa\u7ad9\u8bbf\u95ee&#xff08;GitHub API\u3001\u5305\u7ba1\u7406\u5668\u955c\u50cf\u6e90&#xff09;\u3002<\/li>\n<li>\u4e34\u65f6\u8fd0\u884c\u5668&#xff1a;\u6bcf\u6b21\u6267\u884c\u540e\u9500\u6bc1\u5e76\u91cd\u5efa Runner \u5b9e\u4f8b&#xff08;Ephemeral Runner&#xff09;&#xff0c;\u9632\u6b62\u6784\u5efa\u6b8b\u7559\u6587\u4ef6\u6216\u51ed\u8bc1\u88ab\u540e\u7eed\u4f5c\u4e1a\u8bfb\u53d6\u3002<\/li>\n<li>\u6700\u5c0f\u6743\u9650\u539f\u5219&#xff1a;Runner \u6240\u5728\u673a\u5668\u4e0a\u4e0d\u8981\u5b58\u653e\u957f\u671f\u6709\u6548\u7684\u4e91\u670d\u52a1\u51ed\u8bc1&#xff0c;\u4f18\u5148\u4f7f\u7528 OIDC \u77ed\u65f6\u4ee4\u724c\u3002<\/li>\n<\/ul>\n<p>\u5bc6\u94a5\u4e0e\u51ed\u8bc1\u7684\u52a0\u5bc6\u7ba1\u7406<\/p>\n<ul>\n<li>Secrets&#xff1a;\u5728\u4ed3\u5e93\u6216\u7ec4\u7ec7\u7ea7\u522b\u521b\u5efa\u52a0\u5bc6 Secret&#xff08;Settings \u2192 Secrets and variables \u2192 Actions&#xff09;&#xff0c;\u5de5\u4f5c\u6d41\u4e2d\u901a\u8fc7 ${{ secrets.XXX }} \u5f15\u7528\u3002Secrets \u5728\u65e5\u5fd7\u4e2d\u81ea\u52a8\u63a9\u7801&#xff0c;\u4e0d\u4f1a\u88ab\u6253\u5370\u3002<\/li>\n<li>OIDC \u514d\u5bc6\u94a5\u8ba4\u8bc1&#xff1a;\u8fd9\u662f\u4f01\u4e1a\u7ea7\u5b89\u5168\u5b9e\u8df5\u7684\u91cd\u5934\u620f\u3002\u901a\u8fc7 GitHub \u7684 OIDC Provider&#xff0c;\u53ef\u4ee5\u76f4\u63a5\u5411\u4e91\u5382\u5546&#xff08;AWS\u3001GCP\u3001Azure \u7b49&#xff09;\u8bf7\u6c42\u77ed\u65f6\u8bbf\u95ee\u4ee4\u724c&#xff0c;\u65e0\u9700\u5728 Secrets \u4e2d\u5b58\u50a8\u4efb\u4f55\u957f\u671f AK\/SK\u3002\u4f8b\u5982\u5728 AWS \u4e2d\u4f7f\u7528 aws-actions\/configure-aws-credentials \u914d\u5408 OIDC \u5373\u53ef\u5b9e\u73b0\u96f6\u5bc6\u94a5\u8ba4\u8bc1\u3002<\/li>\n<\/ul>\n<p>\u4f9b\u5e94\u94fe\u5b89\u5168<\/p>\n<p>\u5f00\u6e90\u9879\u76ee\u7684\u4f9d\u8d56\u5b89\u5168\u65e5\u76ca\u91cd\u8981&#xff0c;GitHub Actions \u5185\u7f6e\u4e86\u51e0\u4e2a\u5229\u5668&#xff1a;<\/p>\n<ul>\n<li>Dependabot&#xff1a;\u81ea\u52a8\u68c0\u6d4b\u4f9d\u8d56\u7248\u672c\u66f4\u65b0\u548c\u5b89\u5168\u6f0f\u6d1e&#xff0c;\u521b\u5efa PR \u4f9b\u4f60\u5408\u5e76\u3002<\/li>\n<li>CodeQL \/ Dependabot &#043; Actions \u8054\u52a8&#xff1a;\u5728 Dependabot \u521b\u5efa\u7684 PR \u4e0a\u81ea\u52a8\u8fd0\u884c\u5b89\u5168\u626b\u63cf\u548c\u6d4b\u8bd5\u6d41\u6c34\u7ebf&#xff0c;\u786e\u4fdd\u66f4\u65b0\u4e0d\u4f1a\u5f15\u5165\u56de\u5f52\u95ee\u9898\u3002<\/li>\n<li>\u56fa\u5b9a Action \u7248\u672c&#xff1a;\u5f15\u7528 Action \u65f6\u9501\u5b9a\u5230\u5177\u4f53 commit SHA&#xff08;\u5982 uses: actions\/checkout&#064;11bd719&#8230;&#xff09;&#xff0c;\u907f\u514d &#064;v4 \u8fd9\u6837\u7684\u6807\u7b7e\u88ab\u6076\u610f\u7be1\u6539\u3002<\/li>\n<\/ul>\n<p>\u7ec4\u7ec7\u7ea7\u5de5\u4f5c\u6d41\u6a21\u677f\u4e0e\u590d\u7528\u7b56\u7565<\/p>\n<p>\u5f53\u56e2\u961f\u6709\u591a\u4e2a\u4ed3\u5e93\u9700\u8981\u5171\u7528\u6d41\u6c34\u7ebf\u65f6&#xff0c;Reusable Workflows \u662f\u907f\u514d\u91cd\u590d\u914d\u7f6e\u7684\u5173\u952e&#xff1a;<\/p>\n<p><span class=\"token comment\"># .github\/workflows\/ci.yml&#xff08;\u53ef\u590d\u7528\u5de5\u4f5c\u6d41&#xff09;<\/span><br \/>\n<span class=\"token key atrule\">on<\/span><span class=\"token punctuation\">:<\/span><br \/>\n  <span class=\"token key atrule\">workflow_call<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token key atrule\">inputs<\/span><span class=\"token punctuation\">:<\/span><br \/>\n      <span class=\"token key atrule\">node-version<\/span><span class=\"token punctuation\">:<\/span><br \/>\n        <span class=\"token key atrule\">type<\/span><span class=\"token punctuation\">:<\/span> string<br \/>\n        <span class=\"token key atrule\">default<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">&#039;20&#039;<\/span><br \/>\n<span class=\"token key atrule\">jobs<\/span><span class=\"token punctuation\">:<\/span><br \/>\n  <span class=\"token key atrule\">test<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token key atrule\">runs-on<\/span><span class=\"token punctuation\">:<\/span> ubuntu<span class=\"token punctuation\">&#8211;<\/span>latest<br \/>\n    <span class=\"token key atrule\">steps<\/span><span class=\"token punctuation\">:<\/span><br \/>\n      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">uses<\/span><span class=\"token punctuation\">:<\/span> actions\/checkout&#064;v4<br \/>\n      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">uses<\/span><span class=\"token punctuation\">:<\/span> actions\/setup<span class=\"token punctuation\">&#8211;<\/span>node&#064;v4<br \/>\n        <span class=\"token key atrule\">with<\/span><span class=\"token punctuation\">:<\/span><br \/>\n          <span class=\"token key atrule\">node-version<\/span><span class=\"token punctuation\">:<\/span> $<span class=\"token punctuation\">{<\/span><span class=\"token punctuation\">{<\/span> inputs.node<span class=\"token punctuation\">&#8211;<\/span>version <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">}<\/span><br \/>\n      <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">run<\/span><span class=\"token punctuation\">:<\/span> npm test<\/p>\n<p>\u5176\u4ed6\u4ed3\u5e93\u53ea\u9700\u4e00\u884c\u8c03\u7528&#xff1a;<\/p>\n<p><span class=\"token key atrule\">jobs<\/span><span class=\"token punctuation\">:<\/span><br \/>\n  <span class=\"token key atrule\">call-ci<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token key atrule\">uses<\/span><span class=\"token punctuation\">:<\/span> my<span class=\"token punctuation\">&#8211;<\/span>org\/shared<span class=\"token punctuation\">&#8211;<\/span>workflows\/.github\/workflows\/ci.yml&#064;main<br \/>\n    <span class=\"token key atrule\">with<\/span><span class=\"token punctuation\">:<\/span><br \/>\n      <span class=\"token key atrule\">node-version<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token string\">&#039;22&#039;<\/span><\/p>\n<p>\u8fd9\u5957\u7ec4\u5408\u62f3\u80fd\u8ba9\u56e2\u961f\u5728\u5b89\u5168\u53ef\u63a7\u7684\u524d\u63d0\u4e0b&#xff0c;\u4fdd\u6301\u6d41\u6c34\u7ebf\u7684\u9ad8\u6548\u4e0e\u4e00\u81f4\u3002<\/p>\n<h3>7. \u76d1\u63a7\u3001\u544a\u8b66\u4e0e\u6210\u672c\u4f18\u5316<\/h3>\n<p>\u968f\u7740\u9879\u76ee\u91cc\u7684\u5de5\u4f5c\u6d41\u6570\u91cf\u8d8a\u6765\u8d8a\u591a&#xff0c;\u5bf9\u6d41\u6c34\u7ebf\u7684\u201c\u53ef\u89c2\u5bdf\u6027\u201d\u5c31\u6210\u4e86\u521a\u9700&#xff1a;\u54ea\u4e9b\u5de5\u4f5c\u6d41\u5931\u8d25\u4e86&#xff1f;\u8017\u65f6\u662f\u5426\u5f02\u5e38&#xff1f;\u6bcf\u6708\u6d88\u8017\u4e86\u591a\u5c11 Actions \u5206\u949f\u6570&#xff1f;\u8fd9\u4e00\u7ae0\u5e2e\u4f60\u5efa\u7acb\u4e00\u5957\u8f7b\u91cf\u4f46\u5b9e\u7528\u7684\u76d1\u63a7\u4e0e\u6210\u672c\u63a7\u5236\u4f53\u7cfb\u3002<\/p>\n<p>\u5de5\u4f5c\u6d41\u6267\u884c\u72b6\u6001\u76d1\u63a7<\/p>\n<p>GitHub \u5185\u7f6e\u4e86 Actions Insights&#xff08;Settings \u2192 Actions \u2192 Usage&#xff09;&#xff0c;\u53ef\u4ee5\u6309\u5de5\u4f5c\u6d41\u67e5\u770b\u6267\u884c\u6b21\u6570\u3001\u6210\u529f\u7387\u548c\u8017\u65f6\u8d8b\u52bf\u3002\u6b64\u5916&#xff0c;\u8fd8\u53ef\u4ee5\u901a\u8fc7 GitHub API \u62c9\u53d6\u66f4\u7ec6\u7c92\u5ea6\u7684\u6570\u636e&#xff0c;\u7ed3\u5408\u81ea\u5b9a\u4e49\u9762\u677f\u5b9e\u73b0\u53ef\u89c6\u5316\u7684\u76d1\u63a7\u3002\u4f8b\u5982\u7528 gh CLI \u6216 curl \u67e5\u8be2\u6700\u8fd1\u4e00\u6b21\u8fd0\u884c\u7684\u72b6\u6001&#xff1a;<\/p>\n<p>gh run list <span class=\"token parameter variable\">-R<\/span> owner\/repo <span class=\"token parameter variable\">&#8211;limit<\/span> <span class=\"token number\">10<\/span><\/p>\n<p>\u5982\u679c\u9700\u8981\u66f4\u9ad8\u7ea7\u7684\u5206\u6790&#xff0c;\u53ef\u4ee5\u628a\u5de5\u4f5c\u6d41\u8fd0\u884c\u6570\u636e\u901a\u8fc7 Webhook \u63a8\u9001\u5230\u5916\u90e8\u76d1\u63a7\u5e73\u53f0&#xff08;\u5982 Grafana&#xff09;\u3002GitHub Actions \u81ea\u8eab\u4e5f\u652f\u6301 workflow_run \u4e8b\u4ef6&#xff0c;\u53ef\u4ee5\u5728\u67d0\u4e2a\u5de5\u4f5c\u6d41\u7ed3\u675f\u540e\u89e6\u53d1\u53e6\u4e00\u4e2a\u5de5\u4f5c\u6d41&#xff0c;\u7528\u4e8e\u96c6\u4e2d\u6536\u96c6\u8fd0\u884c\u6307\u6807\u3002<\/p>\n<p>\u5931\u8d25\u901a\u77e5\u96c6\u6210<\/p>\n<p>\u6d41\u6c34\u7ebf\u5931\u8d25\u65f6\u9700\u8981\u7b2c\u4e00\u65f6\u95f4\u901a\u77e5\u5230\u56e2\u961f&#xff0c;\u907f\u514d\u7ebf\u4e0a\u95ee\u9898\u6301\u7eed\u6076\u5316\u3002\u4ee5\u4e0b\u5c55\u793a\u51e0\u79cd\u4e3b\u6d41\u534f\u4f5c\u5de5\u5177\u7684\u96c6\u6210\u65b9\u5f0f&#xff1a;<\/p>\n<ul>\n<li>Slack \u901a\u77e5&#xff1a;\u4f7f\u7528\u5b98\u65b9 slackapi\/slack-github-action&#xff0c;\u628a\u5931\u8d25\u4fe1\u606f\u53d1\u9001\u5230\u6307\u5b9a\u9891\u9053\u3002<\/li>\n<\/ul>\n<p><span class=\"token key atrule\">steps<\/span><span class=\"token punctuation\">:<\/span><br \/>\n  <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">name<\/span><span class=\"token punctuation\">:<\/span> Notify Slack on failure<br \/>\n    <span class=\"token key atrule\">if<\/span><span class=\"token punctuation\">:<\/span> failure()<br \/>\n    <span class=\"token key atrule\">uses<\/span><span class=\"token punctuation\">:<\/span> slackapi\/slack<span class=\"token punctuation\">&#8211;<\/span>github<span class=\"token punctuation\">&#8211;<\/span>action&#064;v2<br \/>\n    <span class=\"token key atrule\">with<\/span><span class=\"token punctuation\">:<\/span><br \/>\n      <span class=\"token key atrule\">webhook<\/span><span class=\"token punctuation\">:<\/span> $<span class=\"token punctuation\">{<\/span><span class=\"token punctuation\">{<\/span> secrets.SLACK_WEBHOOK_URL <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">}<\/span><br \/>\n      <span class=\"token key atrule\">webhook-type<\/span><span class=\"token punctuation\">:<\/span> incoming<span class=\"token punctuation\">&#8211;<\/span>webhook<br \/>\n      <span class=\"token key atrule\">payload<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token punctuation\">|<\/span><span class=\"token scalar string\"><br \/>\n        text: &#034;\u2757 Workflow *${{ github.workflow }}* failed on ${{ github.ref }}&#034;<\/span><\/p>\n<ul>\n<li>\u9489\u9489\/\u98de\u4e66\u901a\u77e5&#xff1a;\u7531\u4e8e\u6ca1\u6709\u5b98\u65b9 Action&#xff0c;\u901a\u5e38\u7528 curl \u8c03\u7528\u81ea\u5b9a\u4e49\u673a\u5668\u4eba Webhook\u3002<\/li>\n<\/ul>\n<p><span class=\"token key atrule\">steps<\/span><span class=\"token punctuation\">:<\/span><br \/>\n  <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">name<\/span><span class=\"token punctuation\">:<\/span> Notify DingTalk on failure<br \/>\n    <span class=\"token key atrule\">if<\/span><span class=\"token punctuation\">:<\/span> failure()<br \/>\n    <span class=\"token key atrule\">run<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token punctuation\">|<\/span><span class=\"token scalar string\"><br \/>\n      curl -H &#034;Content-Type: application\/json&#034; \\\\<br \/>\n           -d &#039;{&#034;msgtype&#034;:&#034;text&#034;,&#034;text&#034;:{&#034;content&#034;:&#034;\u26a0\ufe0f GitHub Actions \u5de5\u4f5c\u6d41\u5931\u8d25&#034;}}&#039; \\\\<br \/>\n           ${{ secrets.DINGTALK_WEBHOOK }}<\/span><\/p>\n<ul>\n<li>\u90ae\u4ef6\u901a\u77e5&#xff1a;\u53ef\u4f7f\u7528 dawidd6\/action-send-mail \u7b49\u793e\u533a Action&#xff0c;\u6216\u901a\u8fc7\u4f01\u4e1a\u90ae\u4ef6\u7f51\u5173\u7684 API \u53d1\u9001\u3002<\/li>\n<\/ul>\n<p><span class=\"token key atrule\">steps<\/span><span class=\"token punctuation\">:<\/span><br \/>\n  <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">uses<\/span><span class=\"token punctuation\">:<\/span> dawidd6\/action<span class=\"token punctuation\">&#8211;<\/span>send<span class=\"token punctuation\">&#8211;<\/span>mail&#064;v3<br \/>\n    <span class=\"token key atrule\">if<\/span><span class=\"token punctuation\">:<\/span> failure()<br \/>\n    <span class=\"token key atrule\">with<\/span><span class=\"token punctuation\">:<\/span><br \/>\n      <span class=\"token key atrule\">server_address<\/span><span class=\"token punctuation\">:<\/span> smtp.example.com<br \/>\n      <span class=\"token key atrule\">server_port<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token number\">465<\/span><br \/>\n      <span class=\"token key atrule\">username<\/span><span class=\"token punctuation\">:<\/span> $<span class=\"token punctuation\">{<\/span><span class=\"token punctuation\">{<\/span> secrets.MAIL_USERNAME <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">}<\/span><br \/>\n      <span class=\"token key atrule\">password<\/span><span class=\"token punctuation\">:<\/span> $<span class=\"token punctuation\">{<\/span><span class=\"token punctuation\">{<\/span> secrets.MAIL_PASSWORD <span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">}<\/span><br \/>\n      <span class=\"token key atrule\">subject<\/span><span class=\"token punctuation\">:<\/span> GitHub Actions \u5de5\u4f5c\u6d41\u5931\u8d25\u901a\u77e5<br \/>\n      <span class=\"token key atrule\">to<\/span><span class=\"token punctuation\">:<\/span> devops&#064;example.com<br \/>\n      <span class=\"token key atrule\">from<\/span><span class=\"token punctuation\">:<\/span> CI Bot<br \/>\n      <span class=\"token key atrule\">body<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token punctuation\">|<\/span><span class=\"token scalar string\"><br \/>\n        \u5de5\u4f5c\u6d41 ${{ github.workflow }} \u5728 ${{ github.ref }} \u4e0a\u5931\u8d25&#xff0c;\u8be6\u89c1&#xff1a;<br \/>\n        ${{ github.server_url }}\/${{ github.repository }}\/actions\/runs\/${{ github.run_id }}<\/span><\/p>\n<p>\u6784\u5efa\u65f6\u957f\u4e0e\u8d44\u6e90\u6d88\u8017\u5206\u6790<\/p>\n<p>\u79c1\u6709\u4ed3\u5e93\u7684 Actions \u7528\u91cf\u76f4\u63a5\u5f71\u54cd\u6210\u672c\u3002GitHub \u63d0\u4f9b\u4e86\u8be6\u7ec6\u7684\u7528\u91cf\u62a5\u8868&#xff0c;\u4f60\u53ef\u4ee5\u5728 Settings \u2192 Actions \u2192 Billing \u4e2d\u67e5\u770b\u6309\u4ed3\u5e93\/\u5de5\u4f5c\u6d41\u7684\u5206\u949f\u6d88\u8017\u3002\u4e3a\u4e86\u63d0\u524d\u9884\u8b66&#xff0c;\u53ef\u4ee5\u8bbe\u7f6e\u7528\u91cf\u9608\u503c\u901a\u77e5&#xff0c;\u6216\u901a\u8fc7 GitHub API \u7f16\u5199\u5b9a\u65f6\u811a\u672c\u76d1\u63a7\u3002<\/p>\n<p>\u53e6\u5916&#xff0c;\u6ce8\u610f\u4ee5\u4e0b\u51e0\u70b9\u53ef\u4ee5\u6709\u6548\u964d\u4f4e\u6784\u5efa\u65f6\u957f&#xff1a;<\/p>\n<ul>\n<li>\u5408\u7406\u4f7f\u7528\u7f13\u5b58&#xff1a;actions\/cache \u80fd\u663e\u8457\u51cf\u5c11\u4f9d\u8d56\u4e0b\u8f7d\u65f6\u95f4&#xff0c;\u6ce8\u610f\u7f13\u5b58 Key \u7684\u7248\u672c\u7b56\u7565&#xff0c;\u907f\u514d\u8fc7\u671f\u7f13\u5b58\u5931\u6548\u3002<\/li>\n<li>\u7f29\u5c0f Runner \u8303\u56f4&#xff1a;\u975e\u5fc5\u8981\u4e0d\u7528 macOS Runner&#xff08;\u6bd4 Linux \u8d35 10 \u500d&#xff09;&#xff0c;\u5c3d\u91cf\u7528 ubuntu-latest\u3002<\/li>\n<li>\u63a7\u5236\u77e9\u9635\u89c4\u6a21&#xff1a;matrix \u7684\u7b1b\u5361\u5c14\u79ef\u53ef\u80fd\u5feb\u901f\u81a8\u80c0&#xff0c;\u53ea\u4fdd\u7559\u5fc5\u8981\u7684\u7ec4\u5408\u3002<\/li>\n<li>\u907f\u514d\u957f\u65f6\u95f4\u8fd0\u884c\u7684 Step&#xff1a;\u8bbe\u7f6e timeout-minutes \u9632\u6b62\u5355\u4e2a\u6b65\u9aa4\u201c\u5361\u6b7b\u201d\u6d88\u8017\u5927\u91cf\u8d44\u6e90\u3002<\/li>\n<\/ul>\n<p><span class=\"token key atrule\">jobs<\/span><span class=\"token punctuation\">:<\/span><br \/>\n  <span class=\"token key atrule\">build<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token key atrule\">timeout-minutes<\/span><span class=\"token punctuation\">:<\/span> <span class=\"token number\">15<\/span><br \/>\n    <span class=\"token key atrule\">runs-on<\/span><span class=\"token punctuation\">:<\/span> ubuntu<span class=\"token punctuation\">&#8211;<\/span>latest<\/p>\n<p>\u6210\u672c\u4f18\u5316\u7b56\u7565<\/p>\n<ul>\n<li>\u5c3d\u91cf\u4f7f\u7528\u516c\u5f00\u4ed3\u5e93&#xff1a;\u516c\u5f00\u4ed3\u5e93\u7684 Actions \u5b8c\u5168\u514d\u8d39&#xff0c;\u9002\u7528\u4e8e\u5f00\u6e90\u9879\u76ee\u6216\u5185\u90e8\u53ef\u516c\u5f00\u7684\u5de5\u5177\u5e93\u3002<\/li>\n<li>\u5f00\u542f\u5e76\u53d1\u9650\u5236&#xff1a;\u9650\u5236\u540c\u4e00\u65f6\u95f4\u5185\u5e76\u884c\u8fd0\u884c\u7684\u4f5c\u4e1a\u6570\u91cf&#xff0c;\u907f\u514d\u7a81\u53d1\u6d41\u91cf\u5bfc\u81f4\u6210\u672c\u98d9\u5347\u3002<\/li>\n<li>\u8c28\u614e\u4f7f\u7528\u81ea\u6258\u7ba1 Runner&#xff1a;\u867d\u7136\u81ea\u6258\u7ba1 Runner \u672c\u8eab\u4e0d\u6d88\u8017 Actions \u5206\u949f\u6570&#xff0c;\u4f46\u670d\u52a1\u5668\u7ef4\u62a4\u672c\u8eab\u4e5f\u6709\u6210\u672c\u3002\u53ea\u6709\u5728\u9700\u8981\u7279\u6b8a\u786c\u4ef6\u6216\u5185\u7f51\u8bbf\u95ee\u65f6\u624d\u81ea\u5efa\u3002<\/li>\n<li>\u5b9a\u671f\u5ba1\u8ba1\u5de5\u4f5c\u6d41&#xff1a;\u5220\u9664\u4e0d\u518d\u4f7f\u7528\u7684\u65e7\u5de5\u4f5c\u6d41\u6587\u4ef6&#xff0c;\u505c\u7528\u957f\u671f\u5931\u8d25\u6216\u65e0\u7528\u7684\u4e00\u952e\u90e8\u7f72\u89e6\u53d1\u5668\u3002<\/li>\n<\/ul>\n<p>\u5de5\u4f5c\u6d41\u8c03\u8bd5\u4e0e\u5e38\u89c1\u6392\u9519\u6280\u5de7<\/p>\n<p>\u5f53\u5de5\u4f5c\u6d41\u5931\u8d25\u65f6&#xff0c;\u4ee5\u4e0b\u8c03\u8bd5\u6280\u5de7\u80fd\u5e2e\u4f60\u5feb\u901f\u5b9a\u4f4d\u95ee\u9898&#xff1a;<\/p>\n<li>\u4f7f\u7528 ACT \u672c\u5730\u8c03\u8bd5&#xff1a;nektos\/act \u53ef\u4ee5\u5728\u672c\u5730\u6a21\u62df GitHub Actions \u73af\u5883&#xff0c;\u907f\u514d\u9891\u7e41\u63a8\u9001\u63d0\u4ea4\u3002<\/li>\n<li>\u542f\u7528 Debug \u65e5\u5fd7&#xff1a;\u5728\u4ed3\u5e93\u8bbe\u7f6e\u4e2d\u5f00\u542f ACTIONS_STEP_DEBUG secret&#xff0c;\u503c\u8bbe\u4e3a true&#xff0c;\u5c31\u53ef\u4ee5\u770b\u5230\u6b65\u9aa4\u5185\u90e8\u7684\u8be6\u7ec6\u6267\u884c\u65e5\u5fd7\u3002<\/li>\n<li>SSH \u8fdc\u7a0b\u8c03\u8bd5&#xff1a;\u5728\u5931\u8d25\u6b65\u9aa4\u4e4b\u524d\u63d2\u5165 mxschmitt\/action-tmate&#xff0c;\u53ef\u4ee5\u5728 Runner \u4e0a\u83b7\u5f97\u4ea4\u4e92\u5f0f SSH&#xff0c;\u76f4\u63a5\u6392\u67e5\u73af\u5883\u95ee\u9898\u3002<\/li>\n<li>\u62c6\u89e3\u590d\u6742\u6b65\u9aa4&#xff1a;\u4e00\u4e2a\u5927\u7684 Shell \u811a\u672c\u5bb9\u6613\u9690\u85cf\u9519\u8bef&#xff0c;\u62c6\u6210\u591a\u4e2a\u5e26\u72ec\u7acb name \u7684\u6b65\u9aa4\u66f4\u6613\u5b9a\u4f4d\u3002<\/li>\n<li>\u68c0\u67e5\u4e0a\u4e0b\u6587\u503c&#xff1a;\u589e\u52a0\u4e00\u4e2a run: echo &#039;${{ toJSON(github) }}&#039; \u7684\u8c03\u8bd5\u6b65\u9aa4&#xff0c;\u8f93\u51fa\u5b8c\u6574\u7684\u4e0a\u4e0b\u6587\u5bf9\u8c61\u7ed9\u4e0b\u6b21\u6392\u67e5\u63d0\u4f9b\u7ebf\u7d22\u3002<\/li>\n<p><span class=\"token key atrule\">steps<\/span><span class=\"token punctuation\">:<\/span><br \/>\n  <span class=\"token punctuation\">&#8211;<\/span> <span class=\"token key atrule\">uses<\/span><span class=\"token punctuation\">:<\/span> mxschmitt\/action<span class=\"token punctuation\">&#8211;<\/span>tmate&#064;v3<br \/>\n    <span class=\"token key atrule\">if<\/span><span class=\"token punctuation\">:<\/span> runner.debug &#061;&#061; &#039;1&#039;<\/p>\n<p>\u628a\u76d1\u63a7\u3001\u544a\u8b66\u3001\u6210\u672c\u4f18\u5316\u8fd9\u4e09\u8005\u4e32\u8054\u5728\u4e00\u8d77&#xff0c;\u4f60\u7684 CI\/CD \u5c31\u4e0d\u518d\u662f\u201c\u9ed1\u76d2\u201d&#xff0c;\u800c\u662f\u53ef\u89c2\u6d4b\u3001\u53ef\u63a7\u5236\u3001\u53ef\u9884\u6d4b\u7684\u5de5\u7a0b\u4f53\u7cfb\u3002<\/p>\n<h3>8. \u603b\u7ed3\u4e0e\u6700\u4f73\u5b9e\u8df5\u6e05\u5355<\/h3>\n<p>\u7ecf\u8fc7\u524d\u9762\u4e03\u7ae0\u7684\u5b9e\u6218\u6f14\u7ec3&#xff0c;\u4f60\u5df2\u7ecf\u4ece\u201c\u6982\u5ff5\u8ba4\u77e5\u201d\u8d70\u5230\u4e86\u201c\u8fdb\u9636\u62d3\u5c55\u201d\u3002\u5728\u6700\u540e\u8fd9\u4e00\u7ae0&#xff0c;\u6211\u4eec\u628a\u6563\u843d\u5404\u5904\u7684\u7ecf\u9a8c\u5f52\u7eb3\u6210\u4e00\u4efd\u53ef\u968f\u65f6\u7ffb\u9605\u7684\u6700\u4f73\u5b9e\u8df5\u6e05\u5355&#xff0c;\u5e2e\u52a9\u4f60\u628a GitHub Actions \u771f\u6b63\u843d\u5730\u5230\u56e2\u961f\u5de5\u4f5c\u4e2d\u3002<\/p>\n<p>\u5de5\u4f5c\u6d41\u8bbe\u8ba1\u7684 SOLID \u539f\u5219<\/p>\n<ul>\n<li>\u5355\u4e00\u804c\u8d23&#xff1a;\u6bcf\u4e2a\u5de5\u4f5c\u6d41\u53ea\u505a\u4e00\u4ef6\u4e8b\u3002\u4e0d\u8981\u5728\u4e00\u4e2a YAML \u91cc\u65e2\u8dd1 CI\u3001\u53c8\u505a\u90e8\u7f72\u3001\u8fd8\u53d1\u901a\u77e5\u3002<\/li>\n<li>\u5f00\u95ed\u539f\u5219&#xff1a;\u901a\u8fc7 inputs \u548c secrets \u5c06\u53ef\u53d8\u90e8\u5206\u53c2\u6570\u5316&#xff0c;\u800c\u4e0d\u662f\u9891\u7e41\u4fee\u6539\u5de5\u4f5c\u6d41\u6587\u4ef6\u672c\u8eab\u3002<\/li>\n<li>\u4f9d\u8d56\u5012\u7f6e&#xff1a;\u901a\u8fc7 Reusable Workflows \u62bd\u8c61\u901a\u7528\u903b\u8f91&#xff0c;\u8ba9\u5177\u4f53\u9879\u76ee\u7684\u6d41\u6c34\u7ebf\u4f9d\u8d56\u62bd\u8c61\u6a21\u677f\u800c\u975e\u590d\u5236\u7c98\u8d34\u3002<\/li>\n<\/ul>\n<p>\u5b89\u5168\u6027\u3001\u53ef\u7ef4\u62a4\u6027\u4e0e\u53ef\u590d\u7528\u6027\u5e73\u8861<\/p>\n<ul>\n<li>\u5b89\u5168\u7b2c\u4e00&#xff1a;\u654f\u611f\u4fe1\u606f\u4e00\u5f8b\u8d70 Secrets \u6216 OIDC&#xff0c;\u7981\u6b62\u786c\u7f16\u7801\u5bc6\u94a5\u3002\u5f15\u7528\u5916\u90e8 Action \u65f6\u56fa\u5b9a\u5230 commit SHA&#xff0c;\u9632\u6b62\u88ab\u7be1\u6539\u3002<\/li>\n<li>\u4fdd\u6301\u53ef\u8bfb\u6027&#xff1a;\u7ed9\u6bcf\u4e2a\u6b65\u9aa4\u8d77\u6e05\u6670\u7684\u540d\u5b57 (name)&#xff0c;\u7528\u6ce8\u91ca\u8bf4\u660e\u5173\u952e\u903b\u8f91&#xff0c;\u63a7\u5236\u5355\u4e2a\u5de5\u4f5c\u6d41\u6587\u4ef6\u957f\u5ea6\u3002<\/li>\n<li>\u590d\u7528\u4f18\u5148&#xff1a;\u5f53\u53d1\u73b0\u591a\u4e2a\u4ed3\u5e93\u4f7f\u7528\u76f8\u4f3c\u6d41\u6c34\u7ebf\u65f6&#xff0c;\u53ca\u65f6\u63d0\u53d6\u4e3a Reusable Workflow&#xff0c;\u51cf\u5c11\u7ef4\u62a4\u8d1f\u62c5\u3002<\/li>\n<\/ul>\n<p>\u5e38\u89c1\u201c\u8e29\u5751\u201d\u7ecf\u9a8c\u6c47\u603b<\/p>\n<li>YAML \u7f29\u8fdb\u9519\u8bef&#xff1a;\u7528\u7a7a\u683c\u4e0d\u8981\u7528 Tab&#xff0c;\u5b57\u7b26\u4e32\u5305\u542b : \u65f6\u8981\u52a0\u5f15\u53f7\u3002<\/li>\n<li>\u8868\u8fbe\u5f0f\u5f15\u53f7\u9677\u9631&#xff1a;\u5728 if \u6761\u4ef6\u4e2d\u76f4\u63a5\u4f7f\u7528 ${{ }}&#xff0c;\u4f46\u5728 run \u547d\u4ee4\u4e2d\u4e0d\u9700\u8981\u5916\u5c42\u8868\u8fbe\u5f0f\u5305\u88f9&#xff0c;\u76f4\u63a5\u7528\u73af\u5883\u53d8\u91cf\u6216\u4e0a\u4e0b\u6587\u3002<\/li>\n<li>\u7f13\u5b58 Key \u4e0d\u552f\u4e00&#xff1a;\u7f13\u5b58 Key \u5982\u679c\u6ca1\u6709\u5408\u7406\u66f4\u65b0\u7b56\u7565&#xff0c;\u4f1a\u5bfc\u81f4\u59cb\u7ec8\u547d\u4e2d\u65e7\u7f13\u5b58&#xff0c;\u7f16\u8bd1\u4ea7\u7269\u4e0d\u5931\u6548\u3002<\/li>\n<li>\u4f5c\u4e1a\u4e4b\u95f4\u73af\u5883\u9694\u79bb&#xff1a;\u6bcf\u4e2a\u4f5c\u4e1a\u9ed8\u8ba4\u8dd1\u5728\u4e0d\u540c Runner \u4e0a&#xff0c;\u6587\u4ef6\u7cfb\u7edf\u4e0d\u5171\u4eab&#xff0c;\u9700\u8981\u4f20\u9012\u6570\u636e\u8bf7\u7528 artifact\u3002<\/li>\n<li>\u5b9a\u65f6\u4efb\u52a1\u7684\u65f6\u533a&#xff1a;schedule \u89e6\u53d1\u5668\u4f7f\u7528 UTC \u65f6\u95f4&#xff0c;\u4f46\u4e0e\u672c\u5730\u65f6\u533a\u53ef\u80fd\u6709\u504f\u5dee&#xff0c;\u9700\u6362\u7b97\u540e\u518d\u8bbe\u5b9a Cron \u8868\u8fbe\u5f0f\u3002<\/li>\n<li>\u79c1\u6709\u4ed3\u5e93\u7684\u514d\u8d39\u989d\u5ea6\u6709\u9650&#xff1a;GitHub Free \u7684\u79c1\u6709\u4ed3\u5e93\u6bcf\u6708\u53ea\u6709 2000 \u5206\u949f&#xff08;Linux&#xff09;&#xff0c;\u8d85\u51fa\u540e\u4f5c\u4e1a\u4f1a\u88ab\u6682\u505c&#xff0c;\u8bb0\u5f97\u63d0\u524d\u76d1\u63a7\u7528\u91cf\u3002<\/li>\n<p>\u4ece\u4e2a\u4eba\u9879\u76ee\u5230\u56e2\u961f\u843d\u5730\u7684\u6f14\u8fdb\u5efa\u8bae<\/p>\n<ul>\n<li>\u4ece\u4e00\u4e2a\u5c0f\u5de5\u4f5c\u6d41\u5f00\u59cb&#xff1a;\u5148\u5b9e\u73b0\u6700\u75db\u70b9\u7684\u81ea\u52a8\u5316&#xff08;\u6bd4\u5982\u4ee3\u7801\u63a8\u9001\u540e\u7684\u81ea\u52a8\u6d4b\u8bd5&#xff09;&#xff0c;\u8dd1\u901a\u5168\u6d41\u7a0b&#xff0c;\u518d\u9010\u6b65\u6dfb\u52a0\u90e8\u7f72\u3001\u901a\u77e5\u7b49\u3002<\/li>\n<li>\u5efa\u7acb\u7ec4\u7ec7\u7ea7\u5de5\u4f5c\u6d41\u6a21\u677f&#xff1a;\u5728 .github \u4ed3\u5e93\u4e2d\u521b\u5efa\u5171\u4eab\u7684 Reusable Workflows&#xff0c;\u914d\u5408\u540c\u6b65\u7684\u7f16\u7801\u89c4\u8303\u548c\u6743\u9650\u7b56\u7565\u3002<\/li>\n<li>\u5f15\u5165\u9884\u63d0\u4ea4\u68c0\u67e5&#xff1a;\u5728 PR \u65f6\u81ea\u52a8\u8fd0\u884c lint\u3001\u683c\u5f0f\u5316\u548c\u5355\u5143\u6d4b\u8bd5&#xff0c;\u628a\u8d28\u91cf\u95e8\u69db\u524d\u7f6e\u3002<\/li>\n<li>\u9010\u6b65\u63a5\u7ba1\u751f\u4ea7\u90e8\u7f72&#xff1a;\u5148\u62ff staging \u73af\u5883\u7ec3\u624b&#xff0c;\u7a33\u5b9a\u8fd0\u884c\u4e00\u6bb5\u65f6\u95f4\u540e\u518d\u5c06\u751f\u4ea7\u90e8\u7f72\u59d4\u6258\u7ed9 Actions&#xff0c;\u540c\u65f6\u4fdd\u7559\u624b\u52a8\u56de\u6eda\u901a\u9053\u3002<\/li>\n<\/ul>\n<p>\u540e\u7eed\u5b66\u4e60\u8d44\u6e90\u63a8\u8350<\/p>\n<ul>\n<li>GitHub Actions \u5b98\u65b9\u6587\u6863&#xff1a;https:\/\/docs.github.com\/en\/actions \u2014\u2014 \u6700\u6743\u5a01\u7684\u53c2\u8003&#xff0c;\u8bed\u6cd5\u548c\u6982\u5ff5\u66f4\u65b0\u53ca\u65f6\u3002<\/li>\n<li>Actions Marketplace&#xff1a;https:\/\/github.com\/marketplace?type&#061;actions \u2014\u2014 \u5bfb\u627e\u73b0\u6210 Action \u7684\u7b2c\u4e00\u7ad9\u3002<\/li>\n<li>Awesome Actions \u4ed3\u5e93&#xff1a;https:\/\/github.com\/sdras\/awesome-actions \u2014\u2014 \u793e\u533a\u6574\u7406\u7684\u4f18\u8d28 Action \u548c\u6559\u7a0b\u5408\u96c6\u3002<\/li>\n<li>nektos\/act&#xff1a;https:\/\/github.com\/nektos\/act \u2014\u2014 \u672c\u5730\u8fd0\u884c GitHub Actions \u7684\u5de5\u5177&#xff0c;\u8c03\u8bd5\u5229\u5668\u3002<\/li>\n<li>\u5b98\u65b9\u5165\u95e8\u4ed3\u5e93&#xff1a;https:\/\/github.com\/actions\/starter-workflows \u2014\u2014 \u5b98\u65b9\u63d0\u4f9b\u7684\u591a\u8bed\u8a00\/\u591a\u6846\u67b6\u6a21\u677f&#xff0c;\u62ff\u6765\u5373\u53ef\u7528\u3002<\/li>\n<\/ul>\n<p>\u81ea\u52a8\u5316\u8fd0\u7ef4\u4e0d\u662f\u4e00\u8e74\u800c\u5c31&#xff0c;\u800c\u662f\u6301\u7eed\u6f14\u8fdb\u7684\u8fc7\u7a0b\u3002\u5e0c\u671b\u8fd9\u7bc7\u5b9e\u6218\u6307\u5357\u80fd\u6210\u4e3a\u4f60\u8e0f\u4e0a GitHub Actions \u4e4b\u8def\u7684\u7b2c\u4e00\u5757\u57fa\u77f3&#xff0c;\u4e5f\u671f\u5f85\u4f60\u5728\u793e\u533a\u91cc\u5206\u4eab\u66f4\u591a\u5b9e\u6218\u7ecf\u9a8c\u548c\u81ea\u5efa Action&#xff0c;\u8ba9\u6574\u4e2a\u751f\u6001\u8d8a\u6765\u8d8a\u597d\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. \u5f15\u8a00&#xff1a;\u4e3a\u4ec0\u4e48\u8981\u7528 GitHub Actions \u505a\u81ea\u52a8\u5316\u8fd0\u7ef4<br \/>\n\u5728\u8f6f\u4ef6\u5de5\u7a0b\u9886\u57df&#xff0c;\u81ea\u52a8\u5316\u65e9\u5df2\u4e0d\u662f\u201c\u9526\u4e0a\u6dfb\u82b1\u201d&#xff0c;\u800c\u662f\u56e2\u961f\u6548\u7387\u7684\u751f\u547d\u7ebf\u3002\u4ece\u6700\u65e9\u7684 Cron \u5b9a\u65f6\u811a\u672c&#xff0c;\u5230 Jenkins \u79f0\u9738 CI \u670d\u52a1\u5668\u5e02\u573a&#xff0c;\u518d\u5230\u5982\u4eca\u4e91\u539f\u751f\u65f6\u4ee3 CI\/CD \u4e0e\u8fd0\u7ef4\u5de5\u5177\u7684\u767e\u82b1\u9f50\u653e&#xff0c;\u81ea\u52a8\u5316\u8fd0\u7ef4\u7684\u7406\u5ff5\u4e00\u8109\u76f8\u627f&#xff0c;\u4f46\u5de5\u5177\u5f62\u6001\u5df2\u53d1\u751f\u4e86\u6df1\u523b\u53d8\u9769\u3002<br \/>\nGitHub Actions \u6b63\u662f\u8fd9\u573a\u53d8\u9769\u4e2d\u7684\u4f7c\u4f7c\u8005\u3002\u81ea 201<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[6994,92,188,395,44],"topic":[],"class_list":["post-88357","post","type-post","status-publish","format-standard","hentry","category-server","tag-sglang","tag-github","tag-188","tag-395","tag-44"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>GitHub Actions \u81ea\u52a8\u5316\u8fd0\u7ef4\u5b9e\u6218\uff1a\u4ece\u5165\u95e8\u5230\u4f01\u4e1a\u7ea7\u843d\u5730 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/88357.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"GitHub Actions \u81ea\u52a8\u5316\u8fd0\u7ef4\u5b9e\u6218\uff1a\u4ece\u5165\u95e8\u5230\u4f01\u4e1a\u7ea7\u843d\u5730 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"1. \u5f15\u8a00&#xff1a;\u4e3a\u4ec0\u4e48\u8981\u7528 GitHub Actions \u505a\u81ea\u52a8\u5316\u8fd0\u7ef4 \u5728\u8f6f\u4ef6\u5de5\u7a0b\u9886\u57df&#xff0c;\u81ea\u52a8\u5316\u65e9\u5df2\u4e0d\u662f\u201c\u9526\u4e0a\u6dfb\u82b1\u201d&#xff0c;\u800c\u662f\u56e2\u961f\u6548\u7387\u7684\u751f\u547d\u7ebf\u3002\u4ece\u6700\u65e9\u7684 Cron \u5b9a\u65f6\u811a\u672c&#xff0c;\u5230 Jenkins \u79f0\u9738 CI \u670d\u52a1\u5668\u5e02\u573a&#xff0c;\u518d\u5230\u5982\u4eca\u4e91\u539f\u751f\u65f6\u4ee3 CI\/CD \u4e0e\u8fd0\u7ef4\u5de5\u5177\u7684\u767e\u82b1\u9f50\u653e&#xff0c;\u81ea\u52a8\u5316\u8fd0\u7ef4\u7684\u7406\u5ff5\u4e00\u8109\u76f8\u627f&#xff0c;\u4f46\u5de5\u5177\u5f62\u6001\u5df2\u53d1\u751f\u4e86\u6df1\u523b\u53d8\u9769\u3002 GitHub Actions \u6b63\u662f\u8fd9\u573a\u53d8\u9769\u4e2d\u7684\u4f7c\u4f7c\u8005\u3002\u81ea 201\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/88357.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-07-31T17:24:24+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/88357.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/88357.html\",\"name\":\"GitHub Actions \u81ea\u52a8\u5316\u8fd0\u7ef4\u5b9e\u6218\uff1a\u4ece\u5165\u95e8\u5230\u4f01\u4e1a\u7ea7\u843d\u5730 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-07-31T17:24:24+00:00\",\"dateModified\":\"2026-07-31T17:24:24+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/88357.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/88357.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/88357.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"GitHub Actions \u81ea\u52a8\u5316\u8fd0\u7ef4\u5b9e\u6218\uff1a\u4ece\u5165\u95e8\u5230\u4f01\u4e1a\u7ea7\u843d\u5730\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"GitHub Actions \u81ea\u52a8\u5316\u8fd0\u7ef4\u5b9e\u6218\uff1a\u4ece\u5165\u95e8\u5230\u4f01\u4e1a\u7ea7\u843d\u5730 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/88357.html","og_locale":"zh_CN","og_type":"article","og_title":"GitHub Actions \u81ea\u52a8\u5316\u8fd0\u7ef4\u5b9e\u6218\uff1a\u4ece\u5165\u95e8\u5230\u4f01\u4e1a\u7ea7\u843d\u5730 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"1. \u5f15\u8a00&#xff1a;\u4e3a\u4ec0\u4e48\u8981\u7528 GitHub Actions \u505a\u81ea\u52a8\u5316\u8fd0\u7ef4 \u5728\u8f6f\u4ef6\u5de5\u7a0b\u9886\u57df&#xff0c;\u81ea\u52a8\u5316\u65e9\u5df2\u4e0d\u662f\u201c\u9526\u4e0a\u6dfb\u82b1\u201d&#xff0c;\u800c\u662f\u56e2\u961f\u6548\u7387\u7684\u751f\u547d\u7ebf\u3002\u4ece\u6700\u65e9\u7684 Cron \u5b9a\u65f6\u811a\u672c&#xff0c;\u5230 Jenkins \u79f0\u9738 CI \u670d\u52a1\u5668\u5e02\u573a&#xff0c;\u518d\u5230\u5982\u4eca\u4e91\u539f\u751f\u65f6\u4ee3 CI\/CD \u4e0e\u8fd0\u7ef4\u5de5\u5177\u7684\u767e\u82b1\u9f50\u653e&#xff0c;\u81ea\u52a8\u5316\u8fd0\u7ef4\u7684\u7406\u5ff5\u4e00\u8109\u76f8\u627f&#xff0c;\u4f46\u5de5\u5177\u5f62\u6001\u5df2\u53d1\u751f\u4e86\u6df1\u523b\u53d8\u9769\u3002 GitHub Actions \u6b63\u662f\u8fd9\u573a\u53d8\u9769\u4e2d\u7684\u4f7c\u4f7c\u8005\u3002\u81ea 201","og_url":"https:\/\/www.wsisp.com\/helps\/88357.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-07-31T17:24:24+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"9 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/88357.html","url":"https:\/\/www.wsisp.com\/helps\/88357.html","name":"GitHub Actions \u81ea\u52a8\u5316\u8fd0\u7ef4\u5b9e\u6218\uff1a\u4ece\u5165\u95e8\u5230\u4f01\u4e1a\u7ea7\u843d\u5730 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-07-31T17:24:24+00:00","dateModified":"2026-07-31T17:24:24+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/88357.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/88357.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/88357.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"GitHub Actions \u81ea\u52a8\u5316\u8fd0\u7ef4\u5b9e\u6218\uff1a\u4ece\u5165\u95e8\u5230\u4f01\u4e1a\u7ea7\u843d\u5730"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/88357","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=88357"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/88357\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=88357"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=88357"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=88357"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=88357"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}