Trigger security scan #24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Hugo Actions # 名字自取 | |
| on: | |
| push: | |
| branches: | |
| - main # 这里的意思是当 main 分支发生 push 的时候,运行下面的 jobs | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest # 在什么环境运行任务 | |
| steps: | |
| - uses: actions/checkout@v4 # 引用actions/checkout这个action,与所在的github仓库同名 | |
| with: | |
| submodules: true # Fetch Hugo themes (true OR recursive) 获取submodule主题 | |
| fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod | |
| token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
| - name: Setup Hugo # 步骤名自取 | |
| uses: peaceiris/actions-hugo@v3 # hugo官方提供的action,用于在任务环境中获取hugo | |
| with: | |
| hugo-version: '0.130.0' # 获取指定版本的hugo | |
| extended: false | |
| - name: Build | |
| run: hugo --minify # 使用 hugo 构建静态网页 | |
| - name: Deploy | |
| uses: peaceiris/actions-gh-pages@v4 # 一个自动发布github pages的action | |
| with: | |
| external_repository: bioitee/BioWebStack # 发布到哪个repo | |
| #1. 创建Personal_Access_Token:GitHub 个人账号 -> Settings -> Developer settings -> Personal access tokens | |
| #2. 粘贴Personal_Access_Token:进入源repo(Nav.Bioitee.Src) -> Settings -> Secrets一栏,选择 New repository secret -> 粘贴personal_token | |
| personal_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} # 发布到其他repo需要提供上面生成的personal access token | |
| publish_dir: ./docs # 注意这里指的是要发布哪个文件夹的内容,而不是指发布到目的仓库的什么位置,因为hugo默认生成静态网页到public文件夹,所以这里发布public文件夹里的内容 | |
| publish_branch: gh-pages # 发布到哪个branch | |
| cname: hao.bioit.top | |
| force_orphan: true | |
| full_commit_message: ${{ github.event.head_commit.message }} |