Skip to content

Commit d2b7067

Browse files
committed
Merge #29: ci: Add preview cookbook workflow
a755900 ci: Add preview cookbook workflow (Jose Storopoli) Pull request description: Add a new workflow file to enable previewing the cookbook. The main advantage here is that in order to review new contributor, the reviewer do not need to run the code locally to render the `mdbook` output. This is useful since not only simplifies the review workflow, but also diminishes the effort that it takes for someone to review a contribution; hence opening opportunities for new reviewers to join in. This workflow runs on pull requests and creates a preview of the cookbook using mdBook. The preview is then uploaded as an artifact. It might be useful to preview a rendered version of the cookbook. ACKs for top commit: apoelstra: ACK a755900 Tree-SHA512: 3275d82db829b21a04b3b654ec050d26bdf1d5dfb7a4de67114841aa52de455853f850326b81e0c78fd7dd220fc11c315ed42ebd721979aa816057166addd9ec
2 parents 1393055 + a755900 commit d2b7067

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: preview cookbook
2+
3+
on:
4+
pull_request: {}
5+
workflow_dispatch: null
6+
7+
jobs:
8+
preview-cookbook:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
# For the comment in the PRs saying that the preview is ready.
12+
issues: write
13+
pull-requests: write
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
submodules: true # could be useful in the future
18+
fetch-depth: 0 # we just need the latest commit
19+
20+
- name: Setup mdBook
21+
uses: peaceiris/actions-mdbook@v2
22+
with:
23+
mdbook-version: 'latest'
24+
25+
- name: Build mdbook
26+
working-directory: ./cookbook
27+
run: mdbook build
28+
29+
- name: Make preview available
30+
if: ${{ github.event_name == 'pull_request' }}
31+
uses: actions/upload-artifact@v4
32+
with:
33+
name: cookbook-preview
34+
path: ./cookbook/book
35+
retention-days: 8

0 commit comments

Comments
 (0)