Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

设置默认发布者; 设置其他GitHub Page项目 #5

Merged
merged 4 commits into from
Oct 15, 2020

Conversation

maboloshi
Copy link
Contributor

  • 设置默认发布者为github-actions[bot]
  • 可设置其他GitHub Page项目而非<actor_username>.github.io

示例:
https://github.com/maboloshi/Blog/actions/runs/308501344/workflow

name: Hexo CICD

on:
  workflow_dispatch:
  push:
      branches:
      - hexo
      paths:
      - 'source/**'
      - 'themes/**'
      - '_config.yml'

jobs:
  build:
    runs-on: ubuntu-latest
    if: "!contains(github.event.head_commit.message, '[ci skip]')"
    steps:
      - name: Checkout
        uses: actions/checkout@v2
        with:
          ref: hexo
          submodules: true
      - name: Cache node modules
        uses: actions/cache@v2
        with:
          path: node_modules
          key: ${{runner.OS}}-node-${{hashFiles('**/package-lock.json')}}
          restore-keys: |
            ${{ runner.os }}-node-
      - uses: maboloshi/github-actions-hexo@dev
        with:
          deploykey: ${{secrets.DEPLOY_KEY}}
          if_keep_commit_history: true
          github_page_repository: Blog

截屏2020-10-15 下午7 59 33

@yrpang
Copy link
Owner

yrpang commented Oct 15, 2020

感谢PR,

但是根据GitHub文档"About GitHub Pages"中"Types of GitHub Pages sites"部分的说明,个人站点的仓库只能命名为<user>.github.io这种形式,所以我感觉添加额外的actor_username选项是没有必要的,你可以测试下你的站点应该会返回404。

不过设置默认发布者是个好主意,麻烦重新提交一下PR,我会merge进去。

@maboloshi
Copy link
Contributor Author

感谢PR,

但是根据GitHub文档"About GitHub Pages"中"Types of GitHub Pages sites"部分的说明,个人站点的仓库只能命名为<user>.github.io这种形式,所以我感觉添加额外的actor_username选项是没有必要的,你可以测试下你的站点应该会返回404。

不过设置默认发布者是个好主意,麻烦重新提交一下PR,我会merge进去。

我为了测试清空过几次, 看了下后台GitHub Pages设置也清空了 已经重新设置好 等github缓存刷新
GitHub Pages设置在非<user>.github.io 会得到项目站http(s)://<user>.github.io/<repository> 这种链接
可通过绑定域名以及域名解析 变成子域名链接

@maboloshi
Copy link
Contributor Author

又添加了一个github_page_repository_branch设置项, GitHub Pages 后台可以手动设置非master分支为GitHub Pages.

@yrpang yrpang merged commit 7f3a33c into yrpang:master Oct 15, 2020
@yrpang
Copy link
Owner

yrpang commented Oct 15, 2020

咦,原来项目站也是可以自定义域名了,印象中之前似乎不可以,不过也可能我一直搞错了。

总之感谢PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants