Repository navigation
69 lines (57 loc) · 1.7 KB
/
Copy pathbook.yml
File metadata and controls
69 lines (57 loc) · 1.7 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Book
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: book-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.12"
# 노트북은 실행하지 않고 저장된 출력을 그대로 렌더링하므로 jupyter만 있으면 됩니다.
- name: Install Jupyter
run: pip install jupyter
- uses: quarto-dev/quarto-actions/setup@v2
with:
version: 1.8.25
- name: Prepare book sources
run: python book/prepare.py
- name: Render book
working-directory: book
run: quarto render --to html
- name: Upload preview
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v7
with:
name: book-preview
path: book/_book
retention-days: 7
# gh-pages 브랜치에 push하지 않고 Pages에 직접 배포합니다(브랜치 보호 규칙과 무관).
- name: Upload Pages artifact
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
uses: actions/upload-pages-artifact@v3
with:
path: book/_book
deploy:
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4