Skip to content

Commit 37fc2a1

Browse files
committed
chore(actions): add gh pages action
1 parent 27fabfd commit 37fc2a1

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

.github/dependabot.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
assignees:
5+
- "shipengqi"
6+
directory: "/"
7+
schedule:
8+
interval: "daily"
9+
time: "08:00"
10+
labels:
11+
- "dependencies"
12+
commit-message:
13+
prefix: "chore"
14+
include: "scope"

.github/workflows/gh-pages.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- master # Set a branch to deploy
7+
paths:
8+
- 'content/**'
9+
pull_request:
10+
paths:
11+
- 'content/**'
12+
jobs:
13+
deploy:
14+
runs-on: ubuntu-latest
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
submodules: true # Fetch Hugo themes (true OR recursive)
21+
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
22+
23+
- name: Setup Hugo
24+
uses: peaceiris/actions-hugo@v3
25+
with:
26+
hugo-version: '0.139.0'
27+
extended: true
28+
29+
- name: Build
30+
run: hugo --minify
31+
32+
- name: Deploy
33+
uses: peaceiris/actions-gh-pages@v4
34+
if: github.ref == 'refs/heads/master'
35+
with:
36+
github_token: ${{ secrets.PAT }}
37+
publish_dir: ./public

0 commit comments

Comments
 (0)