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
48 changes: 48 additions & 0 deletions .github/workflows/preview-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Preview Pages
on:
workflow_dispatch:
permissions: {}
concurrency:
group: site-data-${{ github.repository }}
cancel-in-progress: false
jobs:
build:
if: github.repository == 'shendeguize/OrganonCore' && github.ref == 'refs/heads/main'
runs-on: ubuntu-24.04
timeout-minutes: 30
env:
ORGANON_SITE_PREVIEW: 'true'
permissions:
contents: read
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
with:
path: product
persist-credentials: false
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
with:
node-version: '22.23.2'
- name: Install locked site build dependencies
working-directory: product/tools/site
run: npm ci --ignore-scripts
- name: Build and check current site preview
working-directory: product
env:
ORGANON_CORE_ROOT: ${{ github.workspace }}/product
run: npm run check:site
- uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa
with:
path: product/dist/site/
deploy:
needs: build
runs-on: ubuntu-24.04
timeout-minutes: 10
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e
id: deployment
2 changes: 1 addition & 1 deletion maintenance/pages-and-stars.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Pages and observed GitHub stars

This repository publishes its site from the independent `site-data` branch. `main` CI produces development artifacts. It does not deploy them.
Verified releases use the independent `site-data` branch. `main` CI produces development artifacts. **Preview Pages** (`preview-pages.yml`) may be dispatched manually from `main` to build, check and deploy the current source without a release receipt. A preview is not a verified release, does not update `site-data` or star history, and may be replaced by a later preview or verified release. Deploying it replaces the site currently served at the public Pages URL until another deployment succeeds.

## Publish a released site

Expand Down
2 changes: 1 addition & 1 deletion tools/site/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export function prepare(repo) {
cleanUrls: true, outDir: path.join(repo, 'dist/site'), cacheDir: path.join(repo, 'dist/site-cache'),
appearance: true, lastUpdated: false,
locales: { root: { label: 'English', lang: 'en', themeConfig: { nav: nav('') } }, zh: { label: '简体中文', lang: 'zh-Hans', themeConfig: { nav: nav('zh/'), outlineTitle: '本页内容', returnToTopLabel: '返回顶部', sidebarMenuLabel: '目录', darkModeSwitchLabel: '外观' } } },
themeConfig: { releaseVersion: config.version, outline: [2, 3], socialLinks: [{ icon: 'github', link: `https://github.com/shendeguize/${role}` }], footer: { message: 'Philosophy · methods · grounds / 哲学 · 方法 · 根据', copyright: 'MIT · Organon' } },
themeConfig: { releaseVersion: config.version, preview: process.env.ORGANON_SITE_PREVIEW === 'true', outline: [2, 3], socialLinks: [{ icon: 'github', link: `https://github.com/shendeguize/${role}` }], footer: { message: 'Philosophy · methods · grounds / 哲学 · 方法 · 根据', copyright: 'MIT · Organon' } },
vite: { resolve: { preserveSymlinks: true } }
};
write(path.join(source, '.vitepress/config.mjs'), `export default ${JSON.stringify(vp, null, 2)};\n`);
Expand Down
8 changes: 5 additions & 3 deletions tools/site/theme/Layout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ const { site, lang } = useData();
const route = useRoute();
const router = useRouter();
const chinese = computed(() => lang.value.startsWith('zh'));
const edition = computed(() => /-rc\./.test(site.value.themeConfig.releaseVersion)
? (chinese.value ? '候选发行版 · 等待审核' : 'Release candidate · awaiting review')
: (chinese.value ? '正式发行版' : 'Stable release'));
const edition = computed(() => site.value.themeConfig.preview
? (chinese.value ? '源码预览 · 非发行版' : 'Source preview · not a release')
: /-rc\./.test(site.value.themeConfig.releaseVersion)
? (chinese.value ? '候选发行版 · 等待审核' : 'Release candidate · awaiting review')
: (chinese.value ? '正式发行版' : 'Stable release'));
const peer = computed(() => {
const base = site.value.base;
const path = route.path.slice(base.length).replace(/^zh\//, '');
Expand Down
2 changes: 1 addition & 1 deletion zh/maintenance/pages-and-stars.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Pages 与 GitHub 星标实测

本仓库从独立的 `site-data` 分支发布站点。`main` CI 生成开发产物,不部署这些产物。
已验证发行版使用独立的 `site-data` 分支。`main` CI 生成开发产物。可以从 `main` 手动运行 **Preview Pages**(`preview-pages.yml`),构建并检查当前源码后直接部署,但不生成发行收据。预览站点不是已验证发行版,不更新 `site-data` 或星标历史,并可被后续预览或已验证发行版替换。部署预览会替换 Pages 公开地址当前提供的站点,直至另一次部署成功。

## 发布已发行站点

Expand Down
Loading