Skip to content

Commit f1c2095

Browse files
authored
Merge pull request #64 from janhoy/publish-flag
INFRA-25891 Allow pelican action to run in build only mode (publish=false)
2 parents eeb431f + 56109ae commit f1c2095

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

pelican/README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# ASF Infrastructure Pelican Action
22

33
## Inputs
4-
* destination Pelican Output branch (required) default: asf-site
4+
* destination Pelican Output branch (optional) default: asf-site
5+
* publish Publish to destination branch (optional) default: true
56
* gfm Uses GitHub Flavored Markdown (optional) default: true
67
* output Pelican generated output directory (optional) default: output
78
* tempdir Temporary Directory name (optional) default: ../output
@@ -24,6 +25,22 @@ jobs:
2425
gfm: '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+
publish: 'false'
41+
```
42+
43+
2744
# Pelican Migration Scripts
2845

2946
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)