-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
86 lines (73 loc) · 2.63 KB
/
action.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
# Copyright 2023 Stanford University Convex Optimization Group
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Compile a LaTeX document
description: "Compile a LaTeX document and upload it"
permissions:
contents: write
on:
workflow_call:
inputs:
paper:
description: 'paper'
type: string
required: true
GITHUB_TOKEN:
required: true
output-folder:
description: 'output folder'
type: string
required: false
default: ''
draft:
description: 'branch for draft'
type: string
required: false
default: 'draft'
runs:
using: "composite"
steps:
- name: Set up Git repository
uses: actions/checkout@v4
- uses: actions/cache@v4
name: Tectonic Cache
with:
path: ~/.cache/Tectonic
key: ${{ runner.os }}-tectonic-${{ hashFiles('**/*.tex') }}
restore-keys: |
${{ runner.os }}-tectonic-
- uses: wtfjoke/setup-tectonic@v3
with:
github-token: ${{ inputs.GITHUB_TOKEN }}
biber-version: '2.17'
- name: Run Tectonic
shell: bash
env:
# as recommended by the problems in
# https://github.com/cvxgrp/robust_erm_note/actions/runs/5250958945/jobs/9485425629#step:5:1
RUST_BACKTRACE: '1'
run: |
mkdir -p publish${{ inputs.output-folder }}
echo "Compiling ${{ inputs.paper }}"
for f in ${{ inputs.paper }}
do
echo "-- Compiling $f"
tectonic $f --outdir publish${{ inputs.output-folder }}
done
# Push the paper folder to the draft branch
- name: GitHub Pages action
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: ${{ inputs.draft || 'draft' }} # The branch the action should deploy to.
folder: publish${{ inputs.output-folder }} # The folder the action should deploy.
# To make your draft folder public you would have to go to Settings => Pages