Skip to content

Commit 8c5e0c9

Browse files
committed
Add publish flag
1 parent eeb431f commit 8c5e0c9

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

pelican/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,26 @@ jobs:
2222
with:
2323
destination: master
2424
gfm: 'true'
25+
publish: 'true'
2526
```
2627

28+
Example workflow for only building the site, not publishing. Useful for PR tests:
29+
30+
```
31+
...
32+
jobs:
33+
build-pelican:
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v4
37+
with:
38+
- uses: apache/infrastructure-actions/pelican@main
39+
with:
40+
gfm: 'true'
41+
publish: 'false'
42+
```
43+
44+
2745
# Pelican Migration Scripts
2846

2947
The generate_settings.py script is designed to facilitate migrating away from the

pelican/action.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@ description: "Generate a Pelican website from Markdown"
33
inputs:
44
destination:
55
description: "Pelican Output branch"
6-
required: true
6+
required: false
77
default: "asf-site"
8+
publish:
9+
description: "Publish the site to the destination branch. If false, the site is built but not published."
10+
required: false
11+
default: "true"
812
gfm:
913
description: "Uses GitHub Flavored Markdown"
1014
required: false
@@ -100,6 +104,7 @@ runs:
100104
python3 -B -m pelican content -e "$PP" -o ${{ inputs.tempdir }} $OPTS
101105
102106
- name: Check out previous branch
107+
if: ${{ inputs.publish == 'true' }}
103108
shell: bash
104109
run: |
105110
git config --global user.email "[email protected]"
@@ -119,6 +124,7 @@ runs:
119124
fi
120125
121126
- name: Commit Directly to the branch
127+
if: ${{ inputs.publish == 'true' }}
122128
shell: bash
123129
run: |
124130
# Remove all existing output so deletions will be captured

0 commit comments

Comments
 (0)