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
14 changes: 6 additions & 8 deletions .github/workflows/vulcan-docs.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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
Expand All @@ -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:
Expand All @@ -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"
Expand All @@ -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
;;
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Loading