-
Notifications
You must be signed in to change notification settings - Fork 3
101 lines (87 loc) · 2.71 KB
/
render-samples.yml
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: render samples
on:
pull_request:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
# Build a fresh container for the PR.
build-container:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
# Login against a Docker registry
# https://github.com/docker/login-action
- name: Log into registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v3
# Build and push Docker image as "pandoc_test"
# Only amd64, since we're just building a container
# to be used below in the GH action runner.
- name: Build and publish Docker image
uses: docker/build-push-action@v5
with:
# Cache layers from the container repo.
# This minimizes the amount of times we have to rebuild pandoc.
# Read-only: Avoid cluttering up the cache on pull requests.
cache-from: type=gha
platforms: linux/amd64
push: true
tags: ghcr.io/trustedcomputinggroup/pandoc_test
render-samples:
needs: build-container
runs-on: ubuntu-latest
container:
image: ghcr.io/trustedcomputinggroup/pandoc_test
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/[email protected]
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-tags: true
- name: Cache LaTeX files
uses: actions/cache@v3
env:
cache-name: cache-latex-files
with:
path: |
*.aux
*.fdb_latexmk
*.lof
*.lot
*.toc
*.convert.pdf
key: latex-${{ github.run_id }}
restore-keys: latex
- name: Run the action on guide
uses: trustedcomputinggroup/markdown@latest
with:
input-md: guide.tcg
extra-build-options: "--versioned_filenames --pr_number=${{ github.event.number }} --pr_repo=${{ github.repository }} --diffbase=${{ github.event.pull_request.base.sha }}"
output-pdf: guide.pdf
output-tex: guide.tex
output-docx: guide.docx
- name: Upload PDF
uses: actions/upload-artifact@master
with:
name: PDF
path: guide.*.pdf
- name: Upload TeX
uses: actions/upload-artifact@master
with:
name: TeX
path: guide.*.tex
- name: Upload Docx
uses: actions/upload-artifact@master
with:
name: Word
path: guide.*.docx