Skip to content

Commit 5acbe30

Browse files
committed
chore: refine documentation generation workflow for pull requests
1 parent 11228b5 commit 5acbe30

1 file changed

Lines changed: 9 additions & 19 deletions

File tree

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
name: Test Documentation Generation
22

33
on:
4+
pull_request:
5+
branches:
6+
- this-branch-does-not-exist-so-trigger-never-fires
7+
48
workflow_dispatch:
59
inputs:
610
branch_type:
@@ -12,9 +16,6 @@ on:
1216
- main
1317
- release/v1
1418
- release/v2
15-
pull_request:
16-
branches:
17-
- main
1819

1920
permissions:
2021
contents: read
@@ -27,7 +28,7 @@ jobs:
2728
environment:
2829
name: github-pages-test
2930
url: ${{ steps.deployment.outputs.page_url }}
30-
31+
3132
steps:
3233
- name: Check out code
3334
uses: actions/checkout@v4
@@ -40,25 +41,14 @@ jobs:
4041
- name: Install dependencies
4142
run: npm ci
4243

43-
- name: Set branch type based on trigger
44-
id: set-branch
45-
run: |
46-
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
47-
echo "BRANCH_TYPE=${{ github.event.inputs.branch_type }}" >> $GITHUB_ENV
48-
else
49-
echo "BRANCH_TYPE=main" >> $GITHUB_ENV
50-
fi
51-
echo "VERSION=1.2.3" >> $GITHUB_ENV
52-
5344
- name: Generate documentation
5445
run: |
55-
mkdir -p .github/scripts/docs
56-
bash .github/scripts/docs/generate-and-publish-docs.sh "$BRANCH_TYPE" "$VERSION"
57-
46+
bash .github/scripts/docs/generate-and-publish-docs.sh "${{ github.event.inputs.branch_type }}" "1.2.3"
47+
5848
# Move to Jekyll expected structure
5949
mkdir -p _site
6050
cp -r docs-site/* _site/
61-
51+
6252
# Create .nojekyll file to bypass Jekyll processing
6353
touch _site/.nojekyll
6454
@@ -69,7 +59,7 @@ jobs:
6959
uses: actions/upload-pages-artifact@v3
7060
with:
7161
path: '_site'
72-
62+
7363
- name: Deploy to GitHub Pages
7464
id: deployment
7565
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)