<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
    <channel>
        
        <title>
            <![CDATA[ Jenkins - freeCodeCamp.org ]]>
        </title>
        <description>
            <![CDATA[ freeCodeCamp 是一个免费学习编程的开发者社区，涵盖 Python、HTML、CSS、React、Vue、BootStrap、JSON 教程等，还有活跃的技术论坛和丰富的社区活动，在你学习编程和找工作时为你提供建议和帮助。 ]]>
        </description>
        <link>https://www.freecodecamp.org/chinese/news/</link>
        <image>
            <url>https://cdn.freecodecamp.org/universal/favicons/favicon.png</url>
            <title>
                <![CDATA[ Jenkins - freeCodeCamp.org ]]>
            </title>
            <link>https://www.freecodecamp.org/chinese/news/</link>
        </image>
        <generator>Eleventy</generator>
        <lastBuildDate>Sat, 30 May 2026 19:37:18 +0000</lastBuildDate>
        <atom:link href="https://www.freecodecamp.org/chinese/news/tag/jenkins/rss.xml" rel="self" type="application/rss+xml" />
        <ttl>60</ttl>
        
            <item>
                <title>
                    <![CDATA[ 通过建立 CI/CD 管道来学习 Jenkins ]]>
                </title>
                <description>
                    <![CDATA[ Jenkins 是一个开源的自动化服务器，它使我们能够更加轻松地构建、测试和部署软件。 我们刚刚在 freeCodeCamp.org 的 YouTube 频道上发布了一个视频课程，它将通过展示如何为一个 Web 应用程序构建 CI/CD 管道来带你了解 Jenkins。 这门课程是由 Gwendolyn Faraday 开发的。Gwen 是一位经验丰富的软件开发者，她在自己和 freeCodeCamp 的频道上都有许多受欢迎的课程。 除了 Jenkins，本课程中的项目还使用了这些其他技术：  * 在 Linode 上运行的 Debian 服务器  * Docker 和 Dockerhub  * GitHub  * 一些用于设置的命令行 Jenkins 可以帮助开发者实现软件开发过程的自动化并提高他们的生产力。它还可以帮助用户更轻松地获取一份软件项目的全新构建。Jenkins 是创建 DevOps 管道的一个重要工具。 DevOps 管道是一套流程和工具，可以用它们来实现软件应用程序的持续交付。术语 “DevOps” 是“开发（development）”和“运营（opera ]]>
                </description>
                <link>https://www.freecodecamp.org/chinese/news/learn-jenkins-by-building-a-ci-cd-pipeline/</link>
                <guid isPermaLink="false">63d63138634c950733e7f6a6</guid>
                
                    <category>
                        <![CDATA[ Jenkins ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ HeZean ]]>
                </dc:creator>
                <pubDate>Thu, 26 Jan 2023 04:40:00 +0000</pubDate>
                <media:content url="https://chinese.freecodecamp.org/news/content/images/2023/01/jenkins.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p data-test-label="translation-intro">
        <strong>原文：</strong> <a href="https://www.freecodecamp.org/news/learn-jenkins-by-building-a-ci-cd-pipeline/" target="_blank" rel="noopener noreferrer" data-test-label="original-article-link">Learn Jenkins by Building a CI/CD Pipeline – Full Course</a>
      </p><!--kg-card-begin: markdown--><p>Jenkins 是一个开源的自动化服务器，它使我们能够更加轻松地构建、测试和部署软件。</p>
<p>我们刚刚在 freeCodeCamp.org 的 YouTube 频道上发布了一个视频课程，它将通过展示如何为一个 Web 应用程序构建 CI/CD 管道来带你了解 Jenkins。</p>
<p>这门课程是由 Gwendolyn Faraday 开发的。Gwen 是一位经验丰富的软件开发者，她在自己和 freeCodeCamp 的频道上都有许多受欢迎的课程。</p>
<p>除了 Jenkins，本课程中的项目还使用了这些其他技术：</p>
<ul>
<li>在 Linode 上运行的 Debian 服务器</li>
<li>Docker 和 Dockerhub</li>
<li>GitHub</li>
<li>一些用于设置的命令行</li>
</ul>
<p>Jenkins 可以帮助开发者实现软件开发过程的自动化并提高他们的生产力。它还可以帮助用户更轻松地获取一份软件项目的全新构建。Jenkins 是创建 DevOps 管道的一个重要工具。</p>
<p>DevOps 管道是一套流程和工具，可以用它们来实现软件应用程序的持续交付。术语 “DevOps” 是“开发（development）”和“运营（operations）”两个词的组合。DevOps 管道被用作自动化进行软件开发生命周期中的构建、测试和部署阶段。</p>
<p>本课程中的项目的架构如下。</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/09/image-372.png" alt="image-372" width="600" height="400" loading="lazy"></p>
<p>以下是本课程涉及的所有章节：</p>
<ul>
<li>课程概述</li>
<li>什么是 Jenkins？</li>
<li>术语和定义</li>
<li>项目架构</li>
<li>介绍 Linode</li>
<li>设置 Jenkins</li>
<li>浏览 Jenkins 界面</li>
<li>安装插件</li>
<li>Blue Ocean</li>
<li>创建一个管道</li>
<li>安装 Git</li>
<li>Jenkinsfile</li>
<li>更新管道</li>
<li>配合 npm 使用 Jenkins</li>
<li>Docker 和 Dockerhub</li>
<li>结束语</li>
</ul>
<p>请观看下方的完整版课程视频，你也可以在 <a href="https://www.youtube.com/watch?v=f4idgaq2VqA">freeCodeCamp.org 的 YouTube 频道</a>上找到这个视频（时长约一小时）。</p>
<!--kg-card-end: markdown--> ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ 用 Jenkins 和 Github Actions 实现前端项目自动化部署 ]]>
                </title>
                <description>
                    <![CDATA[ 本教程主要讲解怎么使用 Jenkins 和 Github Actions 部署前端项目。  1. 第一部分是使用 Gitea 配置局域网 git 服务器，再使用 Jenkins 将 Gitea 下的项目部署到局域网服务器。  2. 第二部分是使用 Github Actions 将 Github 项目部署到 Github Page 和阿里云。 阅读本教程并不需要你提前了解 Jenkins 和 Github Actions 的知识，只要按照本教程的指引，就能够实现自动化部署项目。 PS：本人所用电脑操作系统为 windows，即以下所有的操作均在 windows 下运行。其他操作系统的配置大同小异，不会有太大差别。 Gitea + Jenkins 自动构建前端项目并部署到服务器 Gitea 用于构建 Git 局域网服务器，Jenkins 是 CI/CD 工具，用于部署前端项目。 配置 ]]>
                </description>
                <link>https://www.freecodecamp.org/chinese/news/automated-deployment-of-front-end-projects-with-jenkins-and-github-actions/</link>
                <guid isPermaLink="false">61650bdb21a1350622df53c5</guid>
                
                    <category>
                        <![CDATA[ Jenkins ]]>
                    </category>
                
                    <category>
                        <![CDATA[ GitHub ]]>
                    </category>
                
                    <category>
                        <![CDATA[ 前端开发 ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ woai3c ]]>
                </dc:creator>
                <pubDate>Tue, 12 Oct 2021 04:20:00 +0000</pubDate>
                <media:content url="https://chinese.freecodecamp.org/news/content/images/2021/10/article-cover-pic.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>本教程主要讲解怎么使用 Jenkins 和 Github Actions 部署前端项目。</p><ol><li>第一部分是使用 Gitea 配置局域网 git 服务器，再使用 Jenkins 将 Gitea 下的项目部署到局域网服务器。</li><li>第二部分是使用 Github Actions 将 Github 项目部署到 Github Page 和阿里云。</li></ol><p>阅读本教程并不需要你提前了解 Jenkins 和 Github Actions 的知识，只要按照本教程的指引，就能够实现自动化部署项目。</p><p>PS：本人所用电脑操作系统为 windows，即以下所有的操作均在 windows 下运行。其他操作系统的配置大同小异，不会有太大差别。</p><h2 id="gitea-jenkins-">Gitea + Jenkins 自动构建前端项目并部署到服务器</h2><p>Gitea 用于构建 Git 局域网服务器，Jenkins 是 CI/CD 工具，用于部署前端项目。</p><h3 id="-gitea">配置 Gitea</h3><ol><li>下载 <a href="https://link.juejin.cn?target=https%3A%2F%2Fdl.gitea.io%2Fgitea" rel="nofollow noopener noreferrer">Gitea</a>，选择一个喜欢的版本，例如 1.13，选择 <code>gitea-1.13-windows-4.0-amd64.exe</code> 下载。</li><li>下载完后，新建一个目录（例如 gitea），将下载的 Gitea 软件放到该目录下，双击运行。</li><li>打开 <code>localhost:3000</code> 就能看到 Gitea 已经运行在你的电脑上了。</li><li>点击注册，第一次会弹出一个初始配置页面，数据库选择 <code>SQLite3</code>。另外把 <code>localhost</code> 改成你电脑的局域网地址，例如我的电脑 IP 为 <code>192.168.0.118</code>。</li></ol><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/9ff66f2a9ff4436bb46216f9777b1ca8~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="在这里插入图片描述" width="600" height="400" loading="lazy"></figure><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/5685667856ca40ed8f534bc6e344e4ca~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="在这里插入图片描述" width="600" height="400" loading="lazy"></figure><ol><li>填完信息后，点击立即安装，等待一会，即可完成配置。</li><li>继续点击注册用户，第一个注册的用户将会成会管理员。</li><li>打开 Gitea 的安装目录，找到 <code>custom\conf\app.ini</code>，在里面加上一行代码 <code>START_SSH_SERVER = true</code>。这时就可以使用 ssh 进行 push 操作了。</li></ol><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/89726b25bd634c17973e8eeb1d7944a3~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="在这里插入图片描述" width="600" height="400" loading="lazy"></figure><p>8. 如果使用 http 的方式无法克隆项目，请取消 git 代理。</p><pre><code class="language-git">git config --global --unset http.proxy
git config --global --unset https.proxy
复制代码</code></pre><h3 id="-jenkins">配置 Jenkins</h3><ol><li>需要提前安装 JDK，JDK 安装教程网上很多，请自行搜索。</li><li>打开 <a href="https://www.jenkins.io/zh/download/">Jenkins</a> 下载页面。</li></ol><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/f34a061c138a445ca7e35105e68e0d0d~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="在这里插入图片描述" width="600" height="400" loading="lazy"></figure><ol><li>安装过程中遇到 <code>Logon Type</code> 时，选择第一个。</li></ol><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/79c134e86d404d37af1df9ec71c5cf2c~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="在这里插入图片描述" width="600" height="400" loading="lazy"></figure><ol><li>端口默认为 8080，这里我填的是 8000。安装完会自动打开 <code>http://localhost:8000</code> 网站，这时需要等待一会，进行初始化。</li><li>按照提示找到对应的文件（直接复制路径在我的电脑中打开），其中有管理员密码。</li></ol><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/68c2491dc87f40b7a2ed2f3a7c64c624~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="在这里插入图片描述" width="600" height="400" loading="lazy"></figure><p>6. 安装插件，选择第一个。</p><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/de722d8c3568470f8401f696da106848~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="在这里插入图片描述" width="600" height="400" loading="lazy"></figure><ol><li>创建管理员用户，点击完成并保存，然后一路下一步。</li></ol><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/bdbb765c02c14e1f8e839d8abd37f321~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="在这里插入图片描述" width="600" height="400" loading="lazy"></figure><p>8. 配置完成后自动进入首页，这时点击 <code>Manage Jenkins</code> -&gt; <code>Manage plugins</code> 安装插件。</p><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/a9b6d41606164e1f80047d0327c05306~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="在这里插入图片描述" width="600" height="400" loading="lazy"></figure><p>9. 点击 <code>可选插件</code>，输入 nodejs，搜索插件，然后安装。 10. 安装完成后回到首页，点击 <code>Manage Jenkins</code> -&gt; <code>Global Tool Configuration</code> 配置 nodejs。如果你的电脑是 win7 的话，nodejs 版本最好不要太高，选择 v12 左右的就行。</p><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/dc81f6a6588e4ddf9602a400c884bea7~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="在这里插入图片描述" width="600" height="400" loading="lazy"></figure><h3 id="-">创建静态服务器</h3><ol><li>建立一个空目录，在里面执行 <code>npm init -y</code>，初始化项目。</li><li>执行 <code>npm i express</code> 下载 express。</li><li>然后建立一个 <code>server.js</code> 文件，代码如下：</li></ol><pre><code class="language-js">const express = require('express')
const app = express()
const port = 8080

app.use(express.static('dist'))

app.listen(port, () =&gt; {
    console.log(`Example app listening at http://localhost:${port}`)
})
复制代码</code></pre><p>它将当前目录下的 <code>dist</code> 文件夹设为静态服务器资源目录，然后执行 <code>node server.js</code> 启动服务器。</p><p>由于现在没有 <code>dist</code> 文件夹，所以访问网站是空页面。</p><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/de3ae14bee7040709ef8c9e80f68e1c3~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="在这里插入图片描述" width="600" height="400" loading="lazy"></figure><p>不过不要着急，一会就能看到内容了。</p><h3 id="--1">自动构建 + 部署到服务器</h3><ol><li>下载 Jenkins 提供的 demo 项目 <a href="https://link.juejin.cn?target=https%3A%2F%2Fgithub.com%2Fjenkins-docs%2Fbuilding-a-multibranch-pipeline-project" rel="nofollow noopener noreferrer">building-a-multibranch-pipeline-project</a>，然后在你的 Gitea 新建一个仓库，把内容克隆进去，并提交到 Gitea 服务器。</li></ol><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/c452046cb4d446728b2a44eb432b4850~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="在这里插入图片描述" width="600" height="400" loading="lazy"></figure><p>2. 打开 Jenkins 首页，点击 <code>新建 Item</code> 创建项目。</p><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/5427e0513e0e4ce783bf6abd32730c54~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="在这里插入图片描述" width="600" height="400" loading="lazy"></figure><p>3. 选择<code>源码管理</code>，输入你的 Gitea 上的仓库地址。</p><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/a95f9287739445c28eb0d95ac5e37494~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="在这里插入图片描述" width="600" height="400" loading="lazy"></figure><ol><li>你也可以尝试一下定时构建，下面这个代码表示每 5 分钟构建一次。</li></ol><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/06f2030ea15044c6980270ce6e58335b~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="在这里插入图片描述" width="600" height="400" loading="lazy"></figure><ol><li>选择你的构建环境，这里选择刚才配置的 nodejs。</li></ol><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/352fcfd12ee141c68557b6b42ffe640a~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="在这里插入图片描述" width="600" height="400" loading="lazy"></figure><p>6. 点击增加构建步骤，windows 要选 <code>execute windows batch command</code>，linux 要选 <code>execute shell</code>。</p><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/2e6ee4b6dd10431f9ac16318766661e9~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="2e6ee4b6dd10431f9ac16318766661e9~tplv-k3u1fbpfcp-watermark" width="600" height="400" loading="lazy"></figure><ol><li>输入 <code>npm i &amp;&amp; npm run build &amp;&amp; xcopy .\build\* G:\node-server\dist\ /s/e/y</code>，这行命令的作用是安装依赖，构建项目，并将构建后的静态资源复制到指定目录 <code>G:\node-server\dist\ </code>。这个目录是静态服务器资源目录。</li></ol><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/01af43df1d80491e9dd8a489ef57c2f4~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="在这里插入图片描述" width="600" height="400" loading="lazy"></figure><p>8. 保存后，返回首页。点击项目旁边的小三角，选择 <code>build now</code>。</p><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/5cea232eb18e4725b0c57678561bd5d6~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="在这里插入图片描述" width="600" height="400" loading="lazy"></figure><p>9. 开始构建项目，我们可以点击项目查看构建过程。</p><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/faad4f4509964a849c1796d69874ef32~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="在这里插入图片描述" width="600" height="400" loading="lazy"></figure><p>10. 构建成功，打开 <code>http://localhost:8080/</code> 看一下结果。</p><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/c6ef1268d3c7409cabd96e33cf944c93~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="在这里插入图片描述" width="600" height="400" loading="lazy"></figure><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/f46e5659f8b04211b7497852209960da~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="在这里插入图片描述" width="600" height="400" loading="lazy"></figure><p>11. 由于刚才设置了每 5 分钟构建一次，我们可以改变一下网站的内容，然后什么都不做，等待一会再打开网站看看。</p><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/fb5de42e30e44348b0bcc762f3624f02~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="在这里插入图片描述" width="600" height="400" loading="lazy"></figure><p>12. 把修改的内容提交到 Gitea 服务器，稍等一会。打开网站，发现内容已经发生了变化。</p><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/50b88365d90549eb81f0a86954ff62d5~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="在这里插入图片描述" width="600" height="400" loading="lazy"></figure><h3 id="-pipeline-">使用 pipeline 构建项目</h3><p>使用流水线构建项目可以结合 Gitea 的 <code>webhook</code> 钩子，以便在执行 <code>git push</code> 的时候，自动构建项目。</p><ol><li>点击首页右上角的用户名，选择<code>设置</code>。</li></ol><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/5cd283b66d204fa6934509e1891d0f3d~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="在这里插入图片描述" width="600" height="400" loading="lazy"></figure><ol><li>添加 token，记得将 token 保存起来。</li></ol><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/ead6e4c2346d4b5fa03601d1ff7d4824~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="在这里插入图片描述" width="600" height="400" loading="lazy"></figure><ol><li>打开 Jenkins 首页，点击 <code>新建 Item</code> 创建项目。</li></ol><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/51273f6a00384a3d9564b572f83695be~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="在这里插入图片描述" width="600" height="400" loading="lazy"></figure><p>4. 点击<code>构建触发器</code>，选择<code>触发远程构建</code>，填入刚才创建的 token。</p><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/1c9bdcd8fd8549c4a21be519069f620f~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="在这里插入图片描述" width="600" height="400" loading="lazy"></figure><p>5. 选择流水线，按照提示输入内容，然后点击<code>保存</code>。</p><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/b343b4750c0a4c959125a0832e3de5fe~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="在这里插入图片描述" width="600" height="400" loading="lazy"></figure><p>6. 打开 Jenkins 安装目录下的 <code>jenkins.xml</code> 文件，找到 <code>&lt;arguments&gt;</code> 标签，在里面加上 <code>-Dhudson.security.csrf.GlobalCrumbIssuerConfiguration.DISABLE_CSRF_PROTECTION=true</code>。它的作用是关闭 <code>CSRF</code> 验证，不关的话，Gitea 的 <code>webhook</code> 会一直报 403 错误，无法使用。加好参数后，在该目录命令行下输入 <code>jenkins.exe restart</code> 重启 Jenkins。</p><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/c46ea1cc26664600a231615fa2ab0d5c~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="在这里插入图片描述" width="600" height="400" loading="lazy"></figure><p>7. 回到首页，配置全局安全选项。勾上<code>匿名用户具有可读权限</code>，再保存。</p><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/6f2fdfa1709e460ab73fb4429c147ac4~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="在这里插入图片描述" width="600" height="400" loading="lazy"></figure><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/3eb4cf1f1637407abfe7ac811104a3df~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="在这里插入图片描述" width="600" height="400" loading="lazy"></figure><ol><li>打开你的 Gitea 仓库页面，选择<code>仓库设置</code>。</li></ol><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/d66a648f453d4393810a7bfaed1edd7c~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="在这里插入图片描述" width="600" height="400" loading="lazy"></figure><ol><li>点击<code>管理 web 钩子</code>，添加 web 钩子，钩子选项选择 <code>Gitea</code>。</li><li>目标 URL 按照 Jenkins 的提示输入内容。然后点击<code>添加 web 钩子</code>。</li></ol><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/f0f7c0356f1d4126936d77976873c69a~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="在这里插入图片描述" width="600" height="400" loading="lazy"></figure><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/10831af1048c48a5918e2a1dfd05677b~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="在这里插入图片描述" width="600" height="400" loading="lazy"></figure><p>11. 点击创建好的 web 钩子，拉到下方，点击测试推送。不出意外，应该能看到推送成功的消息，此时回到 Jenkins 首页，发现已经在构建项目了。</p><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/f2cbe9a5c87e44ed9d82359893cc8c2f~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="在这里插入图片描述" width="600" height="400" loading="lazy"></figure><p>12. 由于没有配置 <code>Jenkinsfile</code> 文件，此时构建是不会成功的。所以接下来需要配置一下 <code>Jenkinsfile</code> 文件。将以下代码复制到你 Gitea 项目下的 <code>Jenkinsfile</code> 文件。jenkins 在构建时会自动读取文件的内容执行构建及部署操作。</p><pre><code>pipeline {
    agent any
    stages {
        stage('Build') {
            steps {  // window 使用 bat， linux 使用 sh
                bat 'npm i'
                bat 'npm run build'
            }
        }
        stage('Deploy') {
            steps {
                bat 'xcopy .\\build\\* D:\\node-server\\dist\\ /s/e/y' // 这里需要改成你的静态服务器资源目录
            }
        }
    }
}
复制代码</code></pre><ol><li>每当你的 Gitea 项目执行 <code>push</code> 操作时，Gitea 都会通过 <code>webhook</code> 发送一个 post 请求给 Jenkins，让它执行构建及部署操作。</li></ol><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/5fc2ee216393438aa91fd26d0e8096db~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="在这里插入图片描述" width="600" height="400" loading="lazy"></figure><h3 id="--2">小结</h3><p>如果你的操作系统是 Linux，可以在 Jenkins 打包完成后，使用 ssh 远程登录到阿里云，将打包后的文件复制到阿里云上的静态服务器上，这样就能实现阿里云自动部署了。具体怎么远程登录到阿里云，请看下文中的 《Github Actions 部署到阿里云》 一节。</p><h2 id="github-actions-">Github Actions 自动构建前端项目并部署到服务器</h2><p>如果你的项目是 Github 项目，那么使用 Github Actions 也许是更好的选择。</p><h3 id="-github-page">部署到 Github Page</h3><p>接下来看一下如何使用 Github Actions 部署到 Github Page。</p><p>在你需要部署到 Github Page 的项目下，建立一个 yml 文件，放在 <code>.github/workflow</code> 目录下。你可以命名为 <code>ci.yml</code>，它类似于 Jenkins 的 <code>Jenkinsfile</code> 文件，里面包含的是要自动执行的脚本代码。</p><p>这个 yml 文件的内容如下：</p><pre><code class="language-yml">name: Build and Deploy
on: # 监听 master 分支上的 push 事件
  push:
    branches:
      - master
jobs:
  build-and-deploy:
    runs-on: ubuntu-latest # 构建环境使用 ubuntu
    steps:
      - name: Checkout
        uses: actions/checkout@v2.3.1  
        with:
          persist-credentials: false

      - name: Install and Build # 下载依赖 打包项目
        run: |
          npm install
          npm run build

      - name: Deploy # 将打包内容发布到 github page
        uses: JamesIves/github-pages-deploy-action@3.5.9 # 使用别人写好的 actions
        with:  # 自定义环境变量
          ACCESS_TOKEN: ${{ secrets.VUE_ADMIN_TEMPLATE }} # VUE_ADMIN_TEMPLATE 是我的 secret 名称，需要替换成你的
          BRANCH: master
          FOLDER: dist
          REPOSITORY_NAME: woai3c/woai3c.github.io # 这是我的 github page 仓库
          TARGET_FOLDER: github-actions-demo # 打包的文件将放到静态服务器 github-actions-demo 目录下

复制代码</code></pre><p>上面有一个 <code>ACCESS_TOKEN</code> 变量需要自己配置。</p><ol><li>打开 Github 网站，点击你右上角的头像，选择 <code>settings</code>。</li></ol><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/9bb947ff3c7243af92c62b221b472056~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="在这里插入图片描述" width="600" height="400" loading="lazy"></figure><ol><li>点击左下角的 <code>developer settings</code>。</li></ol><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/ea820b671dc64a24b2863c7dd1bdb093~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="在这里插入图片描述" width="600" height="400" loading="lazy"></figure><ol><li>在左侧边栏中，单击 <code>Personal access tokens（个人访问令牌）</code>。</li></ol><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/50368065e962408cb53c938c4b509848~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="在这里插入图片描述" width="600" height="400" loading="lazy"></figure><ol><li>单击 <code>Generate new token（生成新令牌）</code>。</li></ol><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/ebc0215aa43d4bdba85a79d97beeeca3~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="在这里插入图片描述" width="600" height="400" loading="lazy"></figure><ol><li>输入名称并勾选 <code>repo</code>。</li></ol><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/b2aed7e43e6a423199c0a583355d03d5~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="在这里插入图片描述" width="600" height="400" loading="lazy"></figure><ol><li>拉到最下面，点击 <code>Generate token</code>，并将生成的 token 保存起来。</li></ol><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/314f733f0ead462ca497fd49531874ee~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="在这里插入图片描述" width="600" height="400" loading="lazy"></figure><ol><li>打开你的 Github 项目，点击 <code>settings</code>。</li></ol><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/5a7a9afc78d048049e9fcb7e2af40eec~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="在这里插入图片描述" width="600" height="400" loading="lazy"></figure><p>点击 <code>secrets</code>-&gt;<code>new secret</code>。</p><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/5dc749949c5c4238863f12e2eae08805~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="在这里插入图片描述" width="600" height="400" loading="lazy"></figure><p>创建一个密钥，名称随便填（中间用下划线隔开），内容填入刚才创建的 token。</p><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/f112c870534a4ed4878045f4fd4c39fd~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="在这里插入图片描述" width="600" height="400" loading="lazy"></figure><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/d714a34c74e5463cace0552442da3880~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="在这里插入图片描述" width="600" height="400" loading="lazy"></figure><p>将上文代码中的 <code>ACCESS_TOKEN: ${{ secrets.VUE_ADMIN_TEMPLATE }}</code> 替换成刚才创建的 secret 名字，替换后代码如下 <code>ACCESS_TOKEN: ${{ secrets.TEST_A_B }}</code>。保存后，提交到 Github。</p><p>以后你的项目只要执行 <code>git push</code>，Github Actions 就会自动构建项目并发布到你的 Github Page 上。</p><p>Github Actions 的执行详情点击仓库中的 <code>Actions</code> 选项查看。</p><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/9afeda4174cd45b0814552c3a4eaa180~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="在这里插入图片描述" width="600" height="400" loading="lazy"></figure><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/537454335ae947e18a9454988f7e57fc~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="在这里插入图片描述" width="600" height="400" loading="lazy"></figure><p>具体详情可以参考一下我的 demo 项目 <strong><a href="https://link.juejin.cn?target=https%3A%2F%2Fgithub.com%2Fwoai3c%2Fgithub-actions-demo" rel="nofollow noopener noreferrer">github-actions-demo</a></strong>。</p><p>构建成功后，打开 Github Page 网站，可以发现内容已经发布成功。</p><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/11313081f18b40b0a474be43de79ae1c~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="在这里插入图片描述" width="600" height="400" loading="lazy"></figure><h3 id="github-actions--1">Github Actions 部署到阿里云</h3><h4 id="--3">初始化阿里云服务器</h4><ol><li>购买阿里云服务器，选择操作系统，我选的 ubuntu</li><li>在云服务器管理控制台选择实例-&gt;更多-&gt;密钥-&gt;重置实例密码（一会登陆用）</li><li>选择远程连接-&gt;VNC，会弹出一个密码，记住它，以后远程连接要用（ctrl + alt + f1~f6 切换终端，例如 ctrl + alt + f1 是第一个终端）</li><li>进入后是一个命令行 输入 <code>root</code>（默认用户名），密码为你刚才重置的实例密码</li><li>登陆成功， 更新安装源 <code>sudo apt-get update &amp;&amp; sudo apt-get upgrade -y</code></li><li>安装 npm <code>sudo apt-get install npm</code></li><li>安装 npm 管理包 <code>sudo npm install -g n</code></li><li>安装 node 最新稳定版 <code>sudo n stable</code></li></ol><h4 id="--4">创建一个静态服务器</h4><pre><code class="language-js">mkdir node-server // 创建 node-server 文件夹
cd node-server // 进入 node-server 文件夹
npm init -y // 初始化项目
npm i express
touch server.js // 创建 server.js 文件
vim server.js // 编辑 server.js 文件
复制代码</code></pre><p>将以下代码输入进去（用 vim 进入文件后按 i 进行编辑，保存时按 esc 然后输入 :wq，再按 enter），更多使用方法请自行搜索。</p><pre><code class="language-js">const express = require('express')
const app = express()
const port = 3388 // 填入自己的阿里云映射端口，在网络安全组配置。

app.use(express.static('dist'))

app.listen(port, '0.0.0.0', () =&gt; {
    console.log(`listening`)
})
复制代码</code></pre><p>执行 <code>node server.js</code> 开始监听，由于暂时没有 <code>dist</code> 目录，先不要着急。</p><p>注意，监听 IP 必须为 <code>0.0.0.0</code> ，详情请看<a href="https://www.alibabacloud.com/help/zh/doc-detail/50775.htm">部署 Node.js 项目注意事项</a>。</p><p>阿里云入端口要在网络安全组中查看与配置。</p><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/aabf84961fa146ed8345785b069788bd~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="在这里插入图片描述" width="600" height="400" loading="lazy"></figure><h4 id="--5">创建阿里云密钥对</h4><p>请参考<a href="https://www.alibabacloud.com/help/zh/doc-detail/51793.htm">创建 SSH 密钥对</a>和<a href="https://www.alibabacloud.com/help/zh/doc-detail/51796.htm?spm=a2c63.p38356.879954.9.cf992580IYf2O7#concept-zzt-nl1-ydb">绑定 SSH 密钥对</a> ，将你的 ECS 服务器实例和密钥绑定，然后将私钥保存到你的电脑（例如保存在 ecs.pem 文件）。</p><p>打开你要部署到阿里云的 Github 项目，点击 setting-&gt;secrets。</p><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/8c335a8b83c945428221ff8b064a2bd8~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="在这里插入图片描述" width="600" height="400" loading="lazy"></figure><p>点击 new secret</p><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/bbb7d4958522458fb3238388044710df~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="在这里插入图片描述" width="600" height="400" loading="lazy"></figure><p>secret 名称为 <code>SERVER_SSH_KEY</code>，并将刚才的阿里云密钥填入内容。</p><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/ac2bf48aae7c46bdb1e641f832db57c6~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="在这里插入图片描述" width="600" height="400" loading="lazy"></figure><p>点击 add secret 完成。</p><p>在你项目下建立 <code>.github\workflows\ci.yml</code> 文件，填入以下内容：</p><pre><code class="language-yml">name: Build app and deploy to aliyun
on:
  #监听push操作
  push:
    branches:
      # master分支，你也可以改成其他分支
      - master
jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v1
    - name: Install Node.js
      uses: actions/setup-node@v1
      with:
        node-version: '12.16.2'
    - name: Install npm dependencies
      run: npm install
    - name: Run build task
      run: npm run build
    - name: Deploy to Server
      uses: easingthemes/ssh-deploy@v2.1.5
      env:
          SSH_PRIVATE_KEY: ${{ secrets.SERVER_SSH_KEY }}
          ARGS: '-rltgoDzvO --delete'
          SOURCE: dist # 这是要复制到阿里云静态服务器的文件夹名称
          REMOTE_HOST: '118.190.217.8' # 你的阿里云公网地址
          REMOTE_USER: root # 阿里云登录后默认为 root 用户，并且所在文件夹为 root
          TARGET: /root/node-server # 打包后的 dist 文件夹将放在 /root/node-server
复制代码</code></pre><p>保存，推送到 Github 上。</p><p>以后只要你的项目执行 <code>git push</code> 操作，就会自动执行 <code>ci.yml</code> 定义的脚本，将打包文件放到你的阿里云静态服务器上。</p><p>这个 Actions 主要做了两件事：</p><ol><li>克隆你的项目，下载依赖，打包。</li><li>用你的阿里云私钥以 SSH 的方式登录到阿里云，把打包的文件上传（使用 rsync）到阿里云指定的文件夹中。</li></ol><p>如果还是不懂，建议看一下我的 <a href="https://github.com/woai3c/github-actions-aliyun-demo">demo</a>。</p><h3 id="ci-yml-"><code>ci.yml</code> 配置文件讲解</h3><ol><li><code>name</code>，表示这个工作流程（workflow）的名称。</li><li><code>on</code>，表示监听的意思，后面可以加上各种事件，例如 <code>push</code> 事件。</li></ol><p>下面这段代码表示要监听 <code>master</code> 分支的 <code>push</code> 事件。当 Github Actions 监听到 <code>push</code> 事件发生时，它就会执行下面 <code>jobs</code> 定义的一系列操作。</p><pre><code class="language-yml">name: Build app and deploy to aliyun
on:
  #监听push操作
  push:
    branches:
      # master分支，你也可以改成其他分支
      - master
jobs:
...
复制代码</code></pre><ol><li><code>jobs</code>，看字面意思就是一系列的作业，你可以在 <code>jobs</code> 字段下面定义很多作业，例如 <code>job1</code>、<code>job2</code> 等等，并且它们是并行执行的。</li></ol><pre><code class="language-yml">jobs:
  job1:
  	...
  job2:
  	...
  job3:
	...
复制代码</code></pre><p>回头看一下 <code>ci.yml</code> 文件，它只有一个作业，即 <code>build</code>，作业的名称是自己定义的，你叫 <code>good</code> 也可以。</p><ol><li><code>runs-on</code>，表示你这个工作流程要运行在什么操作系统上，<code>ci.yml</code> 文件定义的是最新稳定版的 <code>ubuntu</code>。除了 ubuntu，它还可以选择 Mac 或 Windows。</li></ol><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/aa286b043d2f455d81c1ac034387481c~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="aa286b043d2f455d81c1ac034387481c~tplv-k3u1fbpfcp-watermark" width="600" height="400" loading="lazy"></figure><ol><li><code>steps</code>，看字面意思就是一系列的步骤，也就是说这个作业由一系列的步骤完成。例如先执行 <code>step1</code>，再执行 <code>step2</code>...</li></ol><h4 id="setps-"><code>setps</code> 步骤讲解</h4><p><code>setps</code> 其实是一个数组，在 YAML 语法中，以 <code>-</code> 开始就是一个数组项。例如 <code>['a', 'b', 'c']</code> 用 YAML 语法表示为：</p><pre><code class="language-yml">- a
- b
- c
复制代码</code></pre><p>所以 <code>setps</code> 就是一个步骤数组，从上到下开始执行。从 <code>ci.yml</code> 文件来看，每一个小步骤都有几个相关选项：</p><ol><li><code>name</code>，小步骤的名称。</li><li><code>uses</code>，小步骤使用的 actions 库名称或路径，Github Actions 允许你使用别人写好的 Actions 库。</li><li><code>run</code>，小步骤要执行的 <code>shell</code> 命令。</li><li><code>env</code>，设置与小步骤相关的环境变量。</li><li><code>with</code>，提供参数。</li></ol><figure class="kg-card kg-image-card"><img src="https://p6-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/71864f3ffec24798a7ccb1ca6eb3b1cf~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="71864f3ffec24798a7ccb1ca6eb3b1cf~tplv-k3u1fbpfcp-watermark" width="600" height="400" loading="lazy"></figure><p>综上所述，<code>ci.yml</code> 文件中的 <code>setps</code> 就很好理解了，下面从头到尾解释一边：</p><pre><code class="language-yml">    steps:
    - uses: actions/checkout@v1
    - name: Install Node.js
      uses: actions/setup-node@v1
      with:
        node-version: '12.16.2'
    - name: Install npm dependencies
      run: npm install
    - name: Run build task
      run: npm run build
    - name: Deploy to Server
      uses: easingthemes/ssh-deploy@v2.1.5
      env:
          SSH_PRIVATE_KEY: ${{ secrets.SERVER_SSH_KEY }}
          ARGS: '-rltgoDzvO --delete'
          SOURCE: dist # 这是要复制到阿里云静态服务器的文件夹名称
          REMOTE_HOST: '118.190.217.8' # 你的阿里云公网地址
          REMOTE_USER: root # 阿里云登录后默认为 root 用户，并且所在文件夹为 root
          TARGET: /root/node-server # 打包后的 dist 文件夹将放在 /root/node-server
复制代码</code></pre><ol><li>使用 <code>actions/checkout@v1</code> 库克隆代码到 <code>ubuntu</code> 上。</li><li>使用 <code>actions/setup-node@v1</code> 库安装 nodejs，<code>with</code> 提供了一个参数 <code>node-version</code> 表示要安装的 nodejs 版本。</li><li>在 <code>ubuntu</code> 的 <code>shell</code> 上执行 <code>npm install</code> 下载依赖。</li><li>执行 <code>npm run build</code> 打包项目。</li><li>使用 <code>easingthemes/ssh-deploy@v2.1.5</code> 库，这个库的作用就是用 <code>SSH</code> 的方式远程登录到阿里云服务器，将打包好的文件夹复制到阿里云指定的目录上。</li></ol><p>从 <code>env</code> 上可以看到，这个 actions 库要求我们提供几个环境变量：</p><ol><li><code>SSH_PRIVATE_KEY</code>: 阿里云密钥对中的私钥（需要你提前写在 github secrets 上），</li><li><code>ARGS: '-rltgoDzvO --delete'</code>，没仔细研究，我猜是复制完文件就删除掉。</li><li><code>SOURCE</code>：打包后的文件夹名称</li><li><code>REMOTE_HOST</code>: 阿里云公网 IP 地址</li><li><code>REMOTE_USER</code>: 阿里云服务器的用户名</li><li><code>TARGET</code>: 你要拷贝到阿里云服务器指定目录的名称</li></ol><p>如果你想了解一下其他 actions 库的实现，可以直接复制 actions 库的名称去搜索引擎搜索一下，例如搜索 <code>actions/checkout</code> 的结果为：</p><figure class="kg-card kg-image-card"><img src="https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/d2e353600ce54f1e8b0517c13d596b9c~tplv-k3u1fbpfcp-watermark.awebp" class="kg-image" alt="d2e353600ce54f1e8b0517c13d596b9c~tplv-k3u1fbpfcp-watermark" width="600" height="400" loading="lazy"></figure><p>都看到这了，给个赞再走吧。</p><h2 id="--6">参考资料</h2><ul><li><a href="https://www.jenkins.io/zh/doc/">Jenkins 用户手册</a></li><li><a href="https://docs.github.com/cn/actions">GitHub Actions 文档</a></li><li><a href="https://docs.github.com/cn/pages/getting-started-with-github-pages/about-github-pages">GitHub Pages 文档</a></li><li><a href="https://docs.gitea.io/zh-cn/">Gitea 文档</a></li><li><a href="https://docs.github.com/cn/actions/learn-github-actions/workflow-syntax-for-github-actions">GitHub 操作的工作流程语法</a></li></ul> ]]>
                </content:encoded>
            </item>
        
    </channel>
</rss>
