Skip to content

Commit af0156e

Browse files
authoredMar 15, 2022
add CI/CD gh-pages
1 parent f85033f commit af0156e

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
 

‎.github/workflows/gh-pages.yml

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

0 commit comments

Comments
 (0)