Skip to content

Commit 8c9d598

Browse files
committed
Add publish parameter
1 parent d9bb727 commit 8c9d598

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

.github/workflows/build.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ on:
1414
description: 'Repository to checkout'
1515
required: true
1616
default: 'python/cpython'
17+
publish:
18+
description: 'Publish to GitHub Pages'
19+
required: true
20+
default: false
1721
permissions:
1822
contents: write
1923
jobs:
@@ -103,11 +107,13 @@ jobs:
103107
path: ./Doc/dist/python-${{ github.event.inputs.dist_version }}-docs.epub
104108
if-no-files-found: ignore
105109
- name: Checkout gh-pages branch
110+
if: ${{ github.event.inputs.publish }}
106111
uses: actions/checkout@v4
107112
with:
108113
ref: gh-pages
109114
path: gh-pages
110115
- name: Copy generated archives to gh-pages
116+
if: ${{ github.event.inputs.publish }}
111117
run: |
112118
mkdir -p gh-pages/3
113119
# PDF
@@ -125,6 +131,7 @@ jobs:
125131
# EPUB
126132
cp ./Doc/dist/python-${{ github.event.inputs.dist_version }}-docs.epub gh-pages/3/python-${{ github.event.inputs.dist_version }}-docs.epub 2>/dev/null || true
127133
- name: Commit generated archives
134+
if: ${{ github.event.inputs.publish }}
128135
id: commit
129136
run: |
130137
cd gh-pages
@@ -139,7 +146,7 @@ jobs:
139146
echo "has_changes=true" >> $GITHUB_OUTPUT
140147
fi
141148
- name: Push commit
142-
if: steps.commit.outputs.has_changes == 'true'
149+
if: ${{ github.event.inputs.publish && steps.commit.outputs.has_changes == 'true' }}
143150
uses: ad-m/github-push-action@master
144151
with:
145152
branch: gh-pages

0 commit comments

Comments
 (0)