Skip to content
Closed
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
18 changes: 17 additions & 1 deletion .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ on:
pull_request:
branches: [main]
workflow_dispatch:
inputs:
source_sha:
description: Exact 40-character RazorConsole/RazorConsole commit SHA (defaults to main)
required: false
type: string
schedule:
- cron: '17 5 * * *'

Expand All @@ -18,7 +23,7 @@ concurrency:

env:
SOURCE_REPOSITORY: RazorConsole/RazorConsole
SOURCE_REF: main
SOURCE_REF: ${{ github.event_name == 'workflow_dispatch' && inputs.source_sha || 'main' }}
VITE_SITE_URL: https://razorconsole.github.io
VITE_BASE: /
VITE_ROUTER_BASENAME: /
Expand All @@ -30,6 +35,17 @@ jobs:
outputs:
source-sha: ${{ steps.source.outputs.sha }}
steps:
- name: Validate requested source revision
if: github.event_name == 'workflow_dispatch' && inputs.source_sha != ''
shell: bash
env:
REQUESTED_SOURCE_SHA: ${{ inputs.source_sha }}
run: |
if [[ ! "$REQUESTED_SOURCE_SHA" =~ ^[0-9a-fA-F]{40}$ ]]; then
echo "::error title=Invalid source_sha::source_sha must be exactly 40 hexadecimal characters"
exit 1
fi

- name: Check out website source
uses: actions/checkout@v7
with:
Expand Down
27 changes: 22 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,25 @@ Before the first deployment, an organization owner must open **Settings → Page
deployment** and set **Source** to **GitHub Actions**. The existing project site should not be changed
until the root URL and representative routes return HTTP 200.

To recover or immediately pick up a source change, run **Build and deploy organization site** from
the Actions tab on the `main` branch. GitHub's repository-scoped `GITHUB_TOKEN` cannot trigger a
workflow in another repository, so immediate source-driven deployments would require an explicitly
managed GitHub App or fine-grained token. The scheduled and manual paths require no cross-repository
secret.
To recover or immediately deploy a known source revision, run **Build and deploy organization
site** from the Actions tab on this repository's `main` branch. Set `source_sha` to the full
40-character hexadecimal commit SHA from `RazorConsole/RazorConsole`; leaving it empty builds that
repository's current `main`. The workflow validates a provided value before checkout, and its
summary records both the requested ref and the commit that was actually built.

Source-repository automation can request the same exact revision through the workflow dispatch API:

```json
{
"ref": "main",
"inputs": {
"source_sha": "0123456789abcdef0123456789abcdef01234567"
}
}
```

The caller must replace the example with the source event's full commit SHA and authenticate as a
GitHub App or fine-grained token that can dispatch Actions workflows in this repository. A
repository-scoped `GITHUB_TOKEN` from `RazorConsole/RazorConsole` cannot trigger a workflow in this
repository. Scheduled and push runs continue to build source `main`, and the manual fallback
requires no cross-repository secret.
Loading