Skip to content

Commit 282fbe4

Browse files
committed
new blog
1 parent 30d0bff commit 282fbe4

File tree

1 file changed

+37
-5
lines changed

1 file changed

+37
-5
lines changed
Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,52 @@
1-
name: Jekyll site CI
1+
name: Build and Deploy to GitHub Pages
22

33
on:
44
push:
55
branches: [ "main" ]
66
pull_request:
77
branches: [ "main" ]
88

9+
# GitHub Pages에 배포하기 위한 권한 설정
10+
permissions:
11+
contents: read
12+
pages: write
13+
id-token: write
14+
15+
# 동시 배포 방지
16+
concurrency:
17+
group: "pages"
18+
cancel-in-progress: false
19+
920
jobs:
1021
build:
11-
1222
runs-on: ubuntu-latest
13-
23+
1424
steps:
15-
- uses: actions/checkout@v4
16-
- name: Build the site in the jekyll/builder container
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
28+
- name: Setup Pages
29+
uses: actions/configure-pages@v4
30+
31+
- name: Build with Jekyll
1732
run: |
1833
docker run \
1934
-v ${{ github.workspace }}:/srv/jekyll -v ${{ github.workspace }}/_site:/srv/jekyll/_site \
2035
jekyll/builder:latest /bin/bash -c "chmod -R 777 /srv/jekyll && jekyll build --future"
36+
37+
- name: Upload artifact
38+
uses: actions/upload-pages-artifact@v3
39+
40+
# 배포 작업 (main 브랜치에 push된 경우에만)
41+
deploy:
42+
environment:
43+
name: github-pages
44+
url: ${{ steps.deployment.outputs.page_url }}
45+
runs-on: ubuntu-latest
46+
needs: build
47+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
48+
49+
steps:
50+
- name: Deploy to GitHub Pages
51+
id: deployment
52+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)