-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (29 loc) · 875 Bytes
/
deploy.yml
File metadata and controls
35 lines (29 loc) · 875 Bytes
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
# .github/workflows/deploy.yml
name: Deploy Hugo to docs/
on:
push:
branches: ["main"]
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write # 必须写权限才能推回 main
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: 'latest'
extended: true
- name: Build to docs/
run: hugo --minify --destination docs
- name: Deploy to main branch
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add docs
git commit -m "Deploy Hugo site to docs/ [skip ci]" || echo "No changes"
git push