-
Notifications
You must be signed in to change notification settings - Fork 2
97 lines (78 loc) · 2.41 KB
/
convert.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
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
name: Convert files
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
convert_files:
runs-on: ubuntu-20.04
container: python:3.11.4-bookworm
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Update apt cache
run: apt-get update
- name: Install tex
run: apt-get -y install texlive-latex-base texlive-latex-extra texlive-latex-recommended texlive-fonts-extra latexmk
- name: Install requirements
run: pip install -r requirements.txt
- name: Convert input files
run: python3 -m rules_doc_generator -a -t all
- name: Create pdf output
run: latexmk -pdf -jobname=latex/rules latex/rules.tex
- name: Create pdf output of annotated version
run: latexmk -pdf -jobname=latex_annotated/rules_annotated latex_annotated/rules_annotated.tex
- name: Upload pdf output
uses: actions/upload-artifact@v3
with:
name: pdf-output
path: |
latex/rules.pdf
latex_annotated/rules_annotated.pdf
- name: Upload pdf output
uses: actions/upload-artifact@v3
with:
name: html-output
path: html/*
- name: Upload json output
uses: actions/upload-artifact@v3
with:
name: json-output
path: json/rules.json
- name: Upload php output
uses: actions/upload-artifact@v3
with:
name: php-output
path: php/*
deploy:
if: github.repository == 'rubenpieters/netrunner-comprehensive-rules'
needs: convert_files
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-20.04
steps:
- uses: actions/download-artifact@v3
with:
name: html-output
path: '.'
- name: Move index.html
run: mv rules.html index.html
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: '.'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1