Skip to content

Commit 53a968e

Browse files
committed
change docs release from branch to github actions
1 parent bd65365 commit 53a968e

1 file changed

Lines changed: 25 additions & 12 deletions

File tree

.github/workflows/deploy-docs.yaml

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
1-
name: Deploy Docs
1+
name: Deploy Hugo Docs
22

33
on:
44
push:
55
branches: ["develop"]
66
paths:
7-
- "docs/**" # docs 폴더 변경시에만 실행
7+
- "docs/**"
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
813

914
jobs:
10-
deploy:
15+
build:
1116
runs-on: ubuntu-latest
12-
permissions:
13-
contents: write
1417
steps:
1518
- uses: actions/checkout@v4
1619
with:
17-
submodules: recursive # 테마 서브모듈을 불러옴
20+
submodules: recursive
1821
fetch-depth: 0
1922

2023
- name: Setup Hugo
@@ -26,11 +29,21 @@ jobs:
2629
- name: Build
2730
run: |
2831
cd docs
29-
hugo --minify
32+
# baseURL에 저장소 이름을 포함해야 경로가 깨지지 않습니다.
33+
hugo --minify --baseURL "https://pnu-code-place.github.io/code-place/"
3034
31-
- name: Deploy
32-
uses: peaceiris/actions-gh-pages@v3
35+
- name: Upload artifact
36+
uses: actions/upload-pages-artifact@v3
3337
with:
34-
github_token: ${{ secrets.GITHUB_TOKEN }}
35-
publish_dir: ./docs/public
36-
publish_branch: gh-pages
38+
path: ./docs/public
39+
40+
deploy:
41+
runs-on: ubuntu-latest
42+
needs: build
43+
environment:
44+
name: github-pages
45+
url: ${{ steps.deployment.outputs.page_url }}
46+
steps:
47+
- name: Deploy to GitHub Pages
48+
id: deployment
49+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)