Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 28 additions & 18 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ on:
- "docs/**"
- "scripts/**"
- ".github/workflows/pages.yml"
pull_request:
paths:
- "Reports/**"
- "Posts/**"
- "Contributors/**"
- "assets/**"
- "docs/**"
- "scripts/**"
- ".github/workflows/pages.yml"
workflow_dispatch:
inputs:
runner:
Expand All @@ -23,11 +32,9 @@ on:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages
group: ${{ github.event_name == 'pull_request' && format('pages-pr-{0}', github.event.pull_request.number) || 'pages' }}
cancel-in-progress: false

jobs:
Expand All @@ -36,7 +43,8 @@ jobs:
# 手动 workflow_dispatch 时可在 inputs.runner 选择 ubuntu-latest 作为兜底。
# 注意:runs-on 匹配的是 runner 的 label 而非 name;这里只用 "self-hosted"
# 通用 label 命中我们挂载到本仓库的 self-hosted runner。
runs-on: ${{ inputs.runner == 'ubuntu-latest' && 'ubuntu-latest' || 'self-hosted' }}
# Run unmerged pull request code on an isolated GitHub-hosted runner.
runs-on: ${{ (github.event_name == 'pull_request' || inputs.runner == 'ubuntu-latest') && 'ubuntu-latest' || 'self-hosted' }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -58,6 +66,13 @@ jobs:
fi
gtar --version | head -n 1

- name: Install WebP encoder (Ubuntu)
if: runner.environment == 'github-hosted'
run: sudo apt-get update && sudo apt-get install -y webp

- name: Check WebP encoder
run: cwebp -version

- name: Setup Node
uses: actions/setup-node@v4
with:
Expand All @@ -70,29 +85,24 @@ jobs:
- name: Install build deps
run: npm ci --prefix scripts

- name: Build search & metadata index
run: node scripts/build-index.js
- name: Build static site
run: npm run build --prefix scripts

- name: Assemble _site
run: |
set -euo pipefail
rm -rf _site
mkdir -p _site
cp -R docs/. _site/
cp -R assets _site/assets
cp -R Reports Posts Contributors _site/
touch _site/.nojekyll
# do not ship raw npm install metadata
rm -rf _site/data/.git || true
ls -la _site | head -40
- name: Verify generated pages and search
run: npm test --prefix scripts

- name: Upload Pages artifact
if: github.event_name != 'pull_request'
uses: actions/upload-pages-artifact@v3
with:
path: _site

deploy:
if: github.event_name != 'pull_request'
needs: build
permissions:
pages: write
id-token: write
runs-on: ${{ inputs.runner == 'ubuntu-latest' && 'ubuntu-latest' || 'self-hosted' }}
environment:
name: github-pages
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@

我们也提供了[网页版本](https://swiftolddriver.github.io/iOS-Weekly/)供大家浏览。

维护网页时,在仓库根目录运行 `npm ci --prefix scripts` 和 `npm run build:dev --prefix scripts`,然后打开 `http://localhost:8080/`。网页构建需要 Node.js 20 和 `cwebp`(macOS 可用 `brew install webp`,Ubuntu 可用 `sudo apt-get install webp`)。`npm run build --prefix scripts` 生成 `_site/`,`npm test --prefix scripts` 检查生成的链接和搜索。

周报模板标题下的 `<!-- site: draft -->` 会让该期跳过网页构建,包括首页、归档、搜索和正文页面。发布前移除标记,合入后网页随下一次 GitHub Pages 部署更新。

## [WWDC 内参](https://swiftolddriver.github.io/WWDC-InternalReference/)

**WWDC 内参** 系列是由「老司机技术」牵头组织的精品原创内容系列。已经做了几年了,口碑一直不错。得益于组建的审核团队和不断优化的创作流程,大家创作的内容都已经超越了视频本身的内容,非常有学习和参考意义。
Expand Down
2 changes: 2 additions & 0 deletions Report template.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# 老司机 iOS 周报 #319 | 2026-01-06

<!-- site: draft -->

![ios-weekly](https://github.com/SwiftOldDriver/iOS-Weekly/blob/master/assets/weekly-header/302.jpg?raw=true)
老司机 iOS 周报,只为你呈现有价值的信息。

Expand Down
2 changes: 2 additions & 0 deletions Reports/2026/#384-2026.11.23.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# 老司机 iOS 周报 #384 | 2026-11-23

<!-- site: draft -->

![ios-weekly](https://github.com/SwiftOldDriver/iOS-Weekly/blob/master/assets/weekly-header/384.png?raw=true)
老司机 iOS 周报,只为你呈现有价值的信息。

Expand Down
Loading
Loading