Skip to content

Commit fdad4bd

Browse files
committed
Refine deploy workflow and Quarto config
Update GitHub Actions deploy workflow to ignore changes under .github for push and PR events, set GITHUB_PAT from the repository token, and enable tinytex in the Quarto action. Remove the hardcoded R version and the renv cache step to simplify R setup. In _quarto.yml, add an explicit render pattern for *.qmd files and exclude several non-website files (AGENTS.md, README.md, CHECKLIST.md, LICENSE, build.sh, .gitignore, .gitattributes) to prevent them from being published.
1 parent d5e3223 commit fdad4bd

2 files changed

Lines changed: 17 additions & 13 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@ name: Deploy Courses to GitHub Pages
33
on:
44
push:
55
branches: [main, master]
6+
paths-ignore:
7+
- '.github/**'
68
pull_request:
79
branches: [main, master]
10+
paths-ignore:
11+
- '.github/**'
812
workflow_dispatch:
913

1014
permissions:
@@ -20,7 +24,7 @@ jobs:
2024
build:
2125
runs-on: ubuntu-latest
2226
env:
23-
RENV_PATHS_ROOT: ~/.local/share/renv
27+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
2428

2529
steps:
2630
- name: Checkout repository
@@ -30,21 +34,14 @@ jobs:
3034
uses: quarto-dev/quarto-actions/setup@v2
3135
env:
3236
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
with:
38+
tinytex: true
3339

3440
- name: Setup R
3541
uses: r-lib/actions/setup-r@v2
3642
with:
37-
r-version: '4.3.0'
3843
use-public-rspm: true
3944

40-
- name: Cache R packages
41-
uses: actions/cache@v3
42-
with:
43-
path: ${{ env.RENV_PATHS_ROOT }}
44-
key: ${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }}
45-
restore-keys: |
46-
${{ runner.os }}-renv-
47-
4845
- name: Install R dependencies
4946
run: |
5047
install.packages(c(
@@ -66,7 +63,6 @@ jobs:
6663
6764
- name: Render courses
6865
run: |
69-
# 查找所有课程目录(包含_quarto.yml的子目录)
7066
for course in */; do
7167
course=${course%/}
7268
if [ -d "$course" ] && [ -f "$course/_quarto.yml" ]; then
@@ -79,8 +75,6 @@ jobs:
7975
8076
- name: Organize build output
8177
run: |
82-
# 创建统一的_site目录(根目录渲染已经创建好了)
83-
# 复制各课程构建结果到根_site目录
8478
for course in */; do
8579
course=${course%/}
8680
if [ -d "$course/_site" ]; then

_quarto.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
project:
22
type: website
33
output-dir: _site
4+
render:
5+
- "*.qmd"
6+
exclude:
7+
- "AGENTS.md"
8+
- "README.md"
9+
- "CHECKLIST.md"
10+
- "LICENSE"
11+
- "build.sh"
12+
- ".gitignore"
13+
- ".gitattributes"
414

515
website:
616
title: "CSU生物信息学课程"

0 commit comments

Comments
 (0)