-
Notifications
You must be signed in to change notification settings - Fork 1
78 lines (70 loc) · 2.84 KB
/
gh-pages.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# based on https://github.com/peaceiris/actions-hugo
name: github pages
on:
push: # 在push操作时触发
branches:
- main # Set a branch to deploy
jobs:
deploy:
runs-on: ubuntu-22.04
#指定Ubuntu系统为构建时的编译环境,以下的run命令都是基于该系统运行。类似一个容器环境。
steps:
- uses: actions/checkout@v2
with:
submodules: true # Fetch Hugo themes (true OR recursive)
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.92.2'
extended: true
- name: Build
run: hugo --minify
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.ACCESS_TOKEN }}
# EXTERNAL_REPOSITORY: redisread/redisread.github.io # 如果源码和静态页面存放在不同仓库则需要打开这个选项
publish_dir: ./public
cname: hyoung.site
# #使用Node.js配置自动上传文章索引文件至algolia,实现站内资源搜索功能
# - name: Use Node.js
# uses: actions/setup-node@v1
# with:
# node-version: '15.x'
# - name: Push Argolia Index
# run: |
# npm install algoliasearch
# node push_argolia_index.js
# env:
# ALGOLIA_ADMIN_KEY: ${{ secrets.ALGOLIA_ADMIN_KEY }}
sync: #同步到gitee仓库
needs: deploy
runs-on: ubuntu-latest
steps:
- name: Sync to Gitee
uses: wearerequired/git-mirror-action@master
env:
SSH_PRIVATE_KEY: ${{ secrets.GITEE_RSA_PRIVATE_KEY }}
with:
# 来源仓库,注意替换为你的 GitHub 源仓库地址
source-repo: "[email protected]:HuangPingyang1/HuangPingyang1.github.io.git"
# 目标仓库,注意替换为你的 Gitee 目标仓库地址
destination-repo: "[email protected]:huangpingyang/Hugo_Blog.git"
#2021-05gitee_pages维护更新,无法使用,更新完毕后把下面代码解注释即可同步部署到gitee pages
# gitee pages 需要实名认证,比较麻烦,暂不开启
#reload-pages:
# needs: sync
# runs-on: ubuntu-latest
# steps:
# - name: Build Gitee Pages
# uses: yanglbme/gitee-pages-action@main
# with:
# # 注意替换为你的 Gitee 用户名
# gitee-username: huangpingyang
# # 注意在 Settings->Secrets 配置 GITEE_PASSWORD
# gitee-password: ${{ secrets.GITEE_PASSWORD }}
# # 注意替换为你的 Gitee 仓库,仓库名严格区分大小写,请准确填写,否则会出错
# gitee-repo: huangpingyang/Hugo_Blog
# # 要部署的分支,默认是 master,若是其他分支,则需要指定(指定的分支必须存在)
# branch: gh-pages