From af6dad3d70d7e70000bf99e6e0ca9131395967b9 Mon Sep 17 00:00:00 2001 From: Jim Fan Date: Sun, 15 Nov 2026 14:25:29 -0700 Subject: [PATCH] ci: require manual Hardware docs production publishing --- .github/workflows/vulcan-docs.yml | 14 ++++++-------- README.md | 6 +++--- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/workflows/vulcan-docs.yml b/.github/workflows/vulcan-docs.yml index b3977de..dcbff03 100644 --- a/.github/workflows/vulcan-docs.yml +++ b/.github/workflows/vulcan-docs.yml @@ -1,6 +1,6 @@ name: Vulcan SysDoc -run-name: ${{ github.event.head_commit.message || github.event.pull_request.title || github.ref_name || 'Vulcan SysDoc' }} (${{ github.event_name == 'workflow_dispatch' && inputs.deploy_environment || github.ref_name == 'main' && 'prod' || github.ref_name == 'develop' && 'stg' || 'dev' }}) +run-name: ${{ github.event.head_commit.message || github.event.pull_request.title || github.ref_name || 'Vulcan SysDoc' }} (${{ github.event_name == 'workflow_dispatch' && inputs.deploy_environment || (github.ref_name == 'main' || github.ref_name == 'develop') && 'stg' || 'dev' }}) on: push: @@ -11,7 +11,7 @@ on: workflow_dispatch: inputs: deploy_environment: - description: Vulcan sysdoc environment + description: Vulcan sysdoc environment (prod requires the main branch) required: true default: dev type: choice @@ -26,7 +26,7 @@ permissions: id-token: write concurrency: - group: ${{ github.repository }}-${{ github.workflow }}-${{ github.event_name == 'workflow_dispatch' && inputs.deploy_environment || github.ref_name == 'main' && 'prod' || github.ref_name == 'develop' && 'stg' || 'dev' }} + group: ${{ github.repository }}-${{ github.workflow }}-${{ github.event_name == 'workflow_dispatch' && inputs.deploy_environment || (github.ref_name == 'main' || github.ref_name == 'develop') && 'stg' || 'dev' }} cancel-in-progress: false jobs: @@ -47,9 +47,7 @@ jobs: if [[ -z "${deploy_environment}" ]]; then deploy_environment="${{ vars.VULCAN_ENV || 'dev' }}" fi - elif [[ "${GITHUB_REF}" == "refs/heads/main" ]]; then - deploy_environment="prod" - elif [[ "${GITHUB_REF}" == "refs/heads/develop" ]]; then + elif [[ "${GITHUB_REF}" == "refs/heads/main" || "${GITHUB_REF}" == "refs/heads/develop" ]]; then deploy_environment="stg" elif [[ "${GITHUB_REF}" == "refs/heads/vulcan-dev-sysdoc" ]]; then deploy_environment="dev" @@ -65,8 +63,8 @@ jobs: ;; prod|production) deploy_environment="prod" - if [[ "${GITHUB_REF}" != "refs/heads/main" ]]; then - echo "Production sysdoc deploy is only allowed from refs/heads/main. Current ref: ${GITHUB_REF}" >&2 + if [[ "${GITHUB_EVENT_NAME}" != "workflow_dispatch" || "${GITHUB_REF}" != "refs/heads/main" ]]; then + echo "Production sysdoc requires a manual workflow dispatch on main. Current event: ${GITHUB_EVENT_NAME}, ref: ${GITHUB_REF}" >&2 exit 1 fi ;; diff --git a/README.md b/README.md index b182d5c..e9d5166 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,6 @@ npm run clean `.github/workflows/vulcan-docs.yml` builds the site on Vulcan and publishes the generated static output to the sysdoc S3 bucket for the selected environment. -- Pushes to `develop` and `main` deploy to staging. -- Manual workflow dispatch supports `dev`, `stg`, and `prod`. -- Production deployment is restricted to `main`. +- Successful builds from pushes to `develop` and `main` publish to staging automatically. Pushes to `vulcan-dev-sysdoc` publish to development. +- To release to production, open **Actions → Vulcan SysDoc → Run workflow**, select the `main` branch, and choose `prod`. This builds the selected revision with production configuration and publishes it after the build succeeds. +- Manual runs also support `dev` and `stg` for previewing a branch.