使用 Github Pages 构建和部署错误

问题描述 投票:0回答:1

我正在使用 HTML、CSS 和 JS 并使用 GitHub 存储库创建一个网站。我最近对 index.html 和 stylesheet.css 文件进行了一些更改,当我尝试提交时,弹出了两个错误。请注意,代码中没有任何错误。

以下是错误: Build Error GitHub Deploy Job Skipped

任何帮助将不胜感激!提前非常感谢您。

/* Font Imports */

@import url("https://fonts.googleapis.com/css2?family=Lora:wght@400;500;600&display=swap");

@import url("https://fonts.googleapis.com/css2?family=Work+Sans:wght@300;400;500;600&display=swap");

/* Fonts */

h1 {
  font-family: "Lora", serif;
}

h2 {
  font-family: "Work Sans", sans-serif;
}
/* Placeholder */

* {
  background-color: #eae6e3;
  color: #353535;
}

/* Mobile */

@media only screen and (max-width: 767px) {
  .container-test {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 10px;
    height: 90vh;
  }

  .container-test h1 {
    font-weight: 600;
    font-size: 3.5rem;
  }

  .container-test h2 {
    font-weight: 400;
    font-size: 2rem;
  }

  .container-test img {
    height: 10vh;
  }
}

/* Tablet */

@media screen and (min-width: 768px) and (max-width: 1023px) {
  .container-test {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 10px;
    height: 90vh;
  }

  .container-test h1 {
    font-weight: 600;
    font-size: 4.5rem;
  }

  .container-test h2 {
    font-weight: 400;
    font-size: 2.5rem;
  }

  .container-test img {
    height: 15vh;
  }
}

/* Desktop */

@media screen and (min-width: 1024px) {
  .container-test {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 10px;
    height: 90vh;
  }

  .container-test h1 {
    font-weight: 600;
    font-size: 5.5rem;
  }

  .container-test h2 {
    font-weight: 400;
    font-size: 2.5rem;
  }

  .container-test img {
    height: 25vh;
  }
}

html css github github-pages
1个回答
0
投票

您遇到的错误消息“构建错误 GitHub 部署作业已跳过”表明 GitHub 存储库中的构建过程或部署配置可能存在问题。这可能是由于多种因素造成的,例如配置设置不正确或构建脚本存在问题。

您可以采取以下几个步骤来排查和解决此问题:

  1. 检查构建配置:查看存储库中的构建配置文件。如果您使用静态站点生成器或构建工具,请确保配置设置正确。查找可能导致构建过程失败的任何错误或错误配置。

  2. 查看 GitHub Actions 工作流程:如果您使用 GitHub Actions 进行部署,请检查工作流程文件(通常名为 .github/workflows/main.yml 或类似文件)以确保其配置正确。确保它指向正确的源文件并且正确定义构建和部署步骤。

  3. 检查依赖项和路径:如果您在项目中使用 JavaScript 或 CSS 依赖项,请确保它们被正确引用并包含在您的 HTML 和 CSS 文件中。不正确的路径或缺少依赖项可能会导致构建错误。

  4. 查看构建日志:GitHub 应提供构建日志,以提供有关构建过程失败原因的更多信息。检查这些日志以识别导致构建失败的特定错误消息或问题。

  5. 本地测试:如果可能,请在将更改提交到 GitHub 之前在本地测试您的网站。这可以帮助您在将任何问题或错误推送到存储库之前捕获它们。

  6. 向社区寻求帮助:如果您无法自行识别问题,请考虑向 GitHub 社区寻求帮助,例如 GitHub 支持社区或 Stack Overflow。提供有关您的项目、配置文件以及您遇到的错误消息的相关信息。

  7. 查看部署环境:根据您部署网站的方式,可能存在需要正确配置的特定要求或设置。查看部署平台的文档,确保一切都按预期设置。

  8. 双重检查文件更改:有时在更改文件时可能会无意中引入错误。仔细检查 index.html 和 stylesheet.css 中的更改是否有任何拼写错误、语法错误或意外的修改。 通过仔细检查您的构建配置、GitHub Actions 工作流程和部署设置,您应该能够识别并解决导致构建错误和部署被跳过的问题。

© www.soinside.com 2019 - 2024. All rights reserved.