From bfa4992f492d431aec3d056cc98ab378b22033f9 Mon Sep 17 00:00:00 2001 From: YANG Jingyu Date: Wed, 16 Sep 2026 12:53:14 +0800 Subject: [PATCH] fix(pages): add source preview deployment Add a manual non-release Pages preview and pin the shared site tooling to the Core preview implementation. --- .github/workflows/preview-pages.yml | 59 +++++++++++++++++++++++++++++ maintenance/pages-and-stars.md | 2 +- release/tooling.json | 2 +- zh/maintenance/pages-and-stars.md | 2 +- 4 files changed, 62 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/preview-pages.yml diff --git a/.github/workflows/preview-pages.yml b/.github/workflows/preview-pages.yml new file mode 100644 index 0000000..09386a1 --- /dev/null +++ b/.github/workflows/preview-pages.yml @@ -0,0 +1,59 @@ +name: Preview Pages +on: + workflow_dispatch: +permissions: {} +concurrency: + group: site-data-${{ github.repository }} + cancel-in-progress: false +jobs: + build: + if: github.repository == 'shendeguize/AdvisedOrganons' && 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: Read fixed Core source + id: tooling + working-directory: product + run: | + node --input-type=module -e 'import fs from "node:fs"; const t=JSON.parse(fs.readFileSync("release/tooling.json")); if(t.core?.repository!=="shendeguize/OrganonCore" || !/^[a-f0-9]{40}$/.test(t.core.commit)) throw Error("Unpinned Core tools"); fs.appendFileSync(process.env.GITHUB_OUTPUT,"core="+t.core.commit+"\n");' + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 + with: + repository: shendeguize/OrganonCore + ref: ${{ steps.tooling.outputs.core }} + path: core + persist-credentials: false + - name: Install locked site build dependencies + working-directory: core/tools/site + run: npm ci --ignore-scripts + - name: Build and check current site preview + working-directory: product + env: + ORGANON_CORE_ROOT: ${{ github.workspace }}/core + 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 \ No newline at end of file diff --git a/maintenance/pages-and-stars.md b/maintenance/pages-and-stars.md index d3a10e1..1cb96f8 100644 --- a/maintenance/pages-and-stars.md +++ b/maintenance/pages-and-stars.md @@ -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 diff --git a/release/tooling.json b/release/tooling.json index 63022d3..ec91fe5 100644 --- a/release/tooling.json +++ b/release/tooling.json @@ -6,6 +6,6 @@ }, "core": { "repository": "shendeguize/OrganonCore", - "commit": "77c1ef086cc2eb55d192059e97658abc5ca7f95f" + "commit": "28f5a01274489ae6795e6b76b34c74426b16d550" } } diff --git a/zh/maintenance/pages-and-stars.md b/zh/maintenance/pages-and-stars.md index d81d705..00b2e17 100644 --- a/zh/maintenance/pages-and-stars.md +++ b/zh/maintenance/pages-and-stars.md @@ -1,6 +1,6 @@ # Pages 与 GitHub 星标实测 -本仓库从独立的 `site-data` 分支发布站点。`main` CI 生成开发产物,不部署这些产物。 +已验证发行版使用独立的 `site-data` 分支。`main` CI 生成开发产物。可以从 `main` 手动运行 **Preview Pages**(`preview-pages.yml`),构建并检查当前源码后直接部署,但不生成发行收据。预览站点不是已验证发行版,不更新 `site-data` 或星标历史,并可被后续预览或已验证发行版替换。部署预览会替换 Pages 公开地址当前提供的站点,直至另一次部署成功。 ## 发布已发行站点