【发布时间】:2020-03-05 01:40:26
【问题描述】:
我有一个简单的github repo,用于托管我的简历内容。我使用 hackmyresume 生成 index.html。我正在使用 Github Actions 运行 npm 构建,它应该将生成的内容发布到 gh-pages 分支。
我的工作流文件有
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Deploy with github-pages
uses: JamesIves/github-pages-deploy-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BASE_BRANCH: master # The branch the action should deploy from.
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: target # The folder the action should deploy.
BUILD_SCRIPT: npm install && npm run-script build
而构建命令是
"build": "hackmyresume BUILD ./src/main/resources/json/fresh/resume.json target/index.html -t compact",
我可以看到生成的 html 文件被提交到 github 分支
https://github.com/emeraldjava/emeraldjava/blob/gh-pages/index.html
但是 gh-page 没有接收到这个?当我点击时出现 404 错误
https://emeraldjava.github.io/emeraldjava/
我相信我的回购设置和秘密是正确的,但我一定遗漏了一些小东西。任何帮助将不胜感激。
【问题讨论】:
-
您是否在存储库设置中启用了 GitHub 页面并选择部署
gh-pages分支? -
是的 - 项目设置有 'gh-pages' 分支作为 github 页面的来源。
-
不 - 这是一个不同的仓库:github.com/emeraldjava/emeraldjava.github.io
-
嗯——很奇怪,来自这个问题stackoverflow.com/questions/20422279/…。我在 github 浏览器编辑器中手动编辑了 gh-pages index.html 文件,所有后续的 Action 构建似乎都已发布,即使这样我删除了 gh-pages 分支。
标签: github-pages github-actions github-pages-deploy-action