This is an automated email from the ASF dual-hosted git repository.
hsluoyz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/casbin-editor.git
The following commit(s) were added to refs/heads/master by this push:
new d706d43 feat: publish to asf-site branch
d706d43 is described below
commit d706d430e1916722640d3ef87c8a9230a83a3af8
Author: Yang Luo <[email protected]>
AuthorDate: Sat Mar 28 12:22:26 2026 +0800
feat: publish to asf-site branch
---
.github/workflows/gh-pages.yml | 89 ------------------------------------------
.github/workflows/master.yml | 59 ++++++++++++++++++++++++++++
README.md | 19 ++++++++-
package.json | 2 +-
4 files changed, 77 insertions(+), 92 deletions(-)
diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml
deleted file mode 100644
index a963912..0000000
--- a/.github/workflows/gh-pages.yml
+++ /dev/null
@@ -1,89 +0,0 @@
-name: Deploy to GitHub Page
-on:
- push:
- branches:
- - master
-
- # Allows you to run this workflow manually from the Actions tab
- workflow_dispatch:
-
-# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
-permissions:
- contents: read
- pages: write
- id-token: write
-
-# Allow only one concurrent deployment, skipping runs queued between the run
in-progress and latest queued.
-# However, do NOT cancel in-progress runs as we want to allow these production
deployments to complete.
-concurrency:
- group: "pages"
- cancel-in-progress: false
-
-jobs:
- # Build job
- build:
- runs-on: ubuntu-latest
- steps:
- - name: Checkout
- uses: actions/checkout@v4
-
- - name: Detect package manager
- id: detect-package-manager
- run: |
- if [ -f "${{ github.workspace }}/yarn.lock" ]; then
- echo "manager=yarn" >> $GITHUB_OUTPUT
- echo "command=install" >> $GITHUB_OUTPUT
- echo "runner=yarn" >> $GITHUB_OUTPUT
- exit 0
- elif [ -f "${{ github.workspace }}/package.json" ]; then
- echo "manager=npm" >> $GITHUB_OUTPUT
- echo "command=ci" >> $GITHUB_OUTPUT
- echo "runner=npx --no-install" >> $GITHUB_OUTPUT
- exit 0
- else
- echo "Unable to determine package manager"
- exit 1
- fi
-
- - name: Setup Node
- uses: actions/setup-node@v4
- with:
- node-version: "lts/*"
- cache: ${{ steps.detect-package-manager.outputs.manager }}
-
- - name: Setup Pages
- uses: actions/configure-pages@v4
-
- - name: Restore cache
- uses: actions/cache@v4
- with:
- path: |
- .next/cache
- # Generate a new cache whenever packages or source files change.
- key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json',
'**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
- # If source files changed but packages didn't, rebuild from a prior
cache.
- restore-keys: |
- ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json',
'**/yarn.lock') }}-
-
- - name: Install dependencies
- run: ${{ steps.detect-package-manager.outputs.manager }} ${{
steps.detect-package-manager.outputs.command }}
-
- - name: Build with Next.js
- run: ${{ steps.detect-package-manager.outputs.runner }} next build
-
- - name: Upload artifact
- uses: actions/upload-pages-artifact@v3
- with:
- path: ./out
-
- # Deployment job
- deploy:
- environment:
- name: github-pages
- url: ${{ steps.deployment.outputs.page_url }}
- runs-on: ubuntu-latest
- needs: build
- steps:
- - name: Deploy to GitHub Pages
- id: deployment
- uses: actions/deploy-pages@v4
diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml
new file mode 100644
index 0000000..7e95514
--- /dev/null
+++ b/.github/workflows/master.yml
@@ -0,0 +1,59 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+name: Build and Deploy
+
+on:
+ workflow_dispatch:
+ push:
+ branches:
+ - master
+ pull_request:
+
+jobs:
+ build-and-deploy:
+ runs-on: ubuntu-latest
+ permissions:
+ contents: write
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Use Node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version: "20.x"
+ cache: yarn
+
+ - name: Install dependencies
+ run: yarn install
+
+ - name: Build
+ run: yarn build
+
+ - name: Add .asf.yaml to site output
+ if: github.event_name != 'pull_request'
+ run: cp .asf.yaml out/.asf.yaml
+
+ - name: Publish to asf-site
+ if: github.event_name != 'pull_request'
+ uses: peaceiris/actions-gh-pages@v4
+ with:
+ github_token: ${{ secrets.GITHUB_TOKEN }}
+ publish_dir: ./out
+ publish_branch: asf-site
+ force_orphan: true
diff --git a/README.md b/README.md
index 32e52b3..0ad431d 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,7 @@
# Casbin-editor
[](#badge)
+[](https://github.com/casbin/casbin-editor/actions/workflows/master.yml)
[](https://github.com/casbin/casbin-editor/actions/workflows/release.yml)
[](https://github.com/casbin/casbin-editor/releases/latest)
[](https://github.com/casbin/casbin-editor/issues)
@@ -16,8 +17,8 @@ It provides functionality such as syntax highlighting and
code completion, just
Try it at either:
-1. Casbin official website: https://casbin.org/editor
-2. Our standalone GitHub pages: https://editor.casbin.org
+1. **Apache Casbin Editor** (official ASF deployment):
[https://casbin-editor.apache.org/](https://casbin-editor.apache.org/)
+2. Casbin website: [https://casbin.org/editor](https://casbin.org/editor)
## How it works?
@@ -25,6 +26,18 @@ Casbin-editor is a pure frontend Javascript project. It uses
[node-casbin](https
This project can be viewed as an example for using node-casbin in the browser.
+## Website deployment (ASF)
+
+The public site is **not** published with GitHub Pages anymore. CI builds the
static Next.js output and pushes it to the repository’s **`asf-site`** branch;
Apache Infrastructure then serves it at **https://casbin-editor.apache.org/**.
+
+- **Workflow:** [.github/workflows/master.yml](.github/workflows/master.yml)
(`Build and Deploy`)
+- **Triggers:** push to `master`, `workflow_dispatch`, and pull requests (PRs
only run build; they do not publish)
+- **Build:** `yarn install` and `yarn build` (static export to the `out/`
directory)
+- **ASF metadata:** root [`.asf.yaml`](.asf.yaml) is copied to `out/.asf.yaml`
before publish so the published tree includes the file Infra expects
+- **Publish:**
[peaceiris/actions-gh-pages](https://github.com/peaceiris/actions-gh-pages)
with `publish_branch: asf-site`, `publish_dir: ./out`, and `force_orphan: true`
(each deploy replaces the branch history for a clean site-only tree)
+
+Repository settings for GitHub Pages (if any) are unrelated to this flow; the
live editor URL is the ASF domain above.
+
## For Dev
```shell
@@ -53,3 +66,5 @@ This project supports being built as an Electron app:
yarn install
yarn dist
```
+
+If the packaged app cannot load the local `out/` bundle, it falls back to
loading **https://casbin-editor.apache.org/** in the window.
diff --git a/package.json b/package.json
index 415d656..9329055 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "casbin-editor",
"version": "1.0.0",
- "homepage": "https://editor.casbin.org/",
+ "homepage": "https://casbin-editor.apache.org/",
"main": "main.js",
"scripts": {
"dev": "next dev",
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]