-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
43 lines (37 loc) · 1.34 KB
/
build-on-pull-request.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# This pipeline builds the PDF ebook on any pull request to master.
name: "Build PDF"
on:
pull_request:
branches:
- master
jobs:
prepare-pdf:
# Focal Fossa. Please don't use 'latest' tags, it's an anti-pattern.
runs-on: ubuntu-20.04
steps:
# Checkout the code.
- name: Checkout
uses: actions/checkout@v2
# Set a descriptive version. For PRs it'll be the short sha.
- name: Set Version
id: set_version
run: echo ::set-output name=VERSION::$(git rev-parse --short HEAD)
# Prepare the content files.
- name: Prepare Content
run: ./scripts/prepare-markdown-for-ebook.sh ${{ steps.set_version.outputs.VERSION }}
# Create a PDF from the prepared markdown.
- name: Prepare PDF
uses: docker://pandoc/latex:2.9
with:
args: "-V toc-title:\"Table Of Contents\" --toc --pdf-engine=pdflatex --standalone --output hacker-laws.pdf hacker-laws.md"
# Publish the PDF and intermediate markdown as an artifact.
- name: Publish PDF Artifact
uses: actions/upload-artifact@master
with:
name: hacker-laws.pdf
path: hacker-laws.pdf
- name: Publish Intermediate Markdown Artifact
uses: actions/upload-artifact@master
with:
name: hacker-laws.md
path: hacker-laws.md