Skip to content

Commit a6e0192

Browse files
committed
feat: add manual trigger capability to documentation workflow
- Add workflow_dispatch with deploy option for manual control - Allow build-and-deploy job to run on manual triggers when deploy=true - Add artifact upload for manual runs to enable testing without deployment - Maintain existing automatic behavior for pushes and PRs Enables manual documentation builds and deployments via GitHub Actions UI
1 parent 9b0a205 commit a6e0192

1 file changed

Lines changed: 23 additions & 2 deletions

File tree

.github/workflows/docs.yml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,19 @@ on:
1616
- 'mkdocs.yml'
1717
- '.github/workflows/docs.yml'
1818
workflow_dispatch:
19+
inputs:
20+
deploy:
21+
description: 'Deploy to GitHub Pages (only works on main branch)'
22+
required: false
23+
default: 'true'
24+
type: boolean
25+
environment:
26+
description: 'Target environment'
27+
required: false
28+
default: 'github-pages'
29+
type: choice
30+
options:
31+
- github-pages
1932

2033
permissions:
2134
contents: read
@@ -77,10 +90,18 @@ jobs:
7790
path: ./site
7891
retention-days: 7
7992

80-
# Build and deploy documentation only on main branch pushes
93+
- name: 📤 Upload documentation artifact (for manual runs)
94+
if: github.event_name == 'workflow_dispatch'
95+
uses: actions/upload-artifact@v4
96+
with:
97+
name: documentation-manual-${{ github.run_number }}
98+
path: ./site
99+
retention-days: 7
100+
101+
# Build and deploy documentation on main branch pushes or manual triggers
81102
build-and-deploy:
82103
name: 🏗️ Build & Deploy Documentation
83-
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
104+
if: github.ref == 'refs/heads/main' && (github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.deploy == true))
84105
needs: validate
85106
runs-on: ubuntu-latest
86107
environment:

0 commit comments

Comments
 (0)