From d8fe39c71a7484e21afd17c3dbc5f3187d9eae39 Mon Sep 17 00:00:00 2001 From: ghv5 Date: Thu, 12 Mar 2026 09:44:39 +0800 Subject: [PATCH 1/6] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E9=A6=96?= =?UTF-8?q?=E9=A1=B5=E9=9D=99=E6=80=81=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 1 + 1 file changed, 1 insertion(+) create mode 100644 index.html diff --git a/index.html b/index.html new file mode 100644 index 0000000..1e17169 --- /dev/null +++ b/index.html @@ -0,0 +1 @@ +

Hello CI/CD

From 9c75b709120fcee9ed341ef4061066e58f0d2998 Mon Sep 17 00:00:00 2001 From: ghv5 Date: Thu, 12 Mar 2026 09:57:02 +0800 Subject: [PATCH 2/6] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E9=A6=96?= =?UTF-8?q?=E9=A1=B5=E6=A0=87=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 1e17169..7b58681 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -

Hello CI/CD

+

Hello GitHub CI/CD2.0

From fe0d7d4fda338a983ea85b1fb81f95f53dd154dc Mon Sep 17 00:00:00 2001 From: ghv5 Date: Thu, 12 Mar 2026 10:03:24 +0800 Subject: [PATCH 3/6] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E9=A6=96?= =?UTF-8?q?=E9=A1=B5=E6=A0=87=E9=A2=981?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 7b58681..1474b7c 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -

Hello GitHub CI/CD2.0

+

Hello GitHub CI/CD3.0

From 1405a40f833bde150fa887300e2ee83bf659b03e Mon Sep 17 00:00:00 2001 From: ghv5 Date: Thu, 12 Mar 2026 10:18:45 +0800 Subject: [PATCH 4/6] =?UTF-8?q?ci:=E6=96=B0=E5=A2=9ECI/CD=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci-cd.yml | 41 +++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/ci-cd.yml diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml new file mode 100644 index 0000000..f8dfcbf --- /dev/null +++ b/.github/workflows/ci-cd.yml @@ -0,0 +1,41 @@ +# 工作流名称 +name: CI/CD for Static Page + +# 触发条件:main分支有push/PR,feature分支有PR +on: + push: + branches: [ master ] + pull_request: + branches: [ master, 'feature/**' ] + +# 工作流任务 +jobs: + # 第一个任务:CI(代码检查) + ci: + runs-on: ubuntu-latest # 运行环境(Linux) + steps: + # 步骤1:拉取代码到GitHub服务器 + - name: Checkout code + uses: actions/checkout@v4 + + # 步骤2:检查HTML文件语法(简单CI示例) + - name: Validate HTML + uses: chabad360/html5validator@v1 + with: + root: ./ # 检查当前目录的HTML文件 + + # 第二个任务:CD(部署到GitHub Pages) + cd: + needs: ci # 依赖ci任务完成且成功 + if: github.event_name == 'push' && github.ref == 'refs/heads/master' # 仅main分支push时触发 + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + # 步骤:部署到GitHub Pages + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} # GitHub自动生成的令牌(无需手动配置) + publish_dir: ./ # 部署的目录(当前目录的所有文件) From 06d0502449ebd90a456579a4e24b860b9ad72e89 Mon Sep 17 00:00:00 2001 From: ghv5 Date: Thu, 12 Mar 2026 10:25:56 +0800 Subject: [PATCH 5/6] =?UTF-8?q?fix:=E6=9B=BF=E6=8D=A2=E4=B8=8D=E5=8F=AF?= =?UTF-8?q?=E7=94=A8=E7=9A=84HTML=E6=A0=A1=E9=AA=8CAction?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci-cd.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index f8dfcbf..0453685 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -20,9 +20,10 @@ jobs: # 步骤2:检查HTML文件语法(简单CI示例) - name: Validate HTML - uses: chabad360/html5validator@v1 - with: - root: ./ # 检查当前目录的HTML文件 + run: | + docker pull validator/validator + docker run --rm -v ${pwd}:/mnt validator/validator nu /mnt/index.html + continue-on-error: false # 第二个任务:CD(部署到GitHub Pages) cd: From b1242556a7b6abf3f66190153549facfb29570a9 Mon Sep 17 00:00:00 2001 From: ghv5 <105958857+ghv5@users.noreply.github.com> Date: Thu, 12 Mar 2026 10:28:32 +0800 Subject: [PATCH 6/6] Remove HTML validation from CI workflow Removed HTML validation step from CI workflow. --- .github/workflows/ci-cd.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 0453685..bfe5458 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -18,13 +18,6 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - # 步骤2:检查HTML文件语法(简单CI示例) - - name: Validate HTML - run: | - docker pull validator/validator - docker run --rm -v ${pwd}:/mnt validator/validator nu /mnt/index.html - continue-on-error: false - # 第二个任务:CD(部署到GitHub Pages) cd: needs: ci # 依赖ci任务完成且成功