Make tiny image for rules + web server. #181
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 -m 03 -d 30 -y 2024 | |
- name: Create pdf output | |
run: latexmk -pdf -jobname=latex/%A latex/*.tex | |
- name: Create pdf output of annotated version | |
run: latexmk -pdf -jobname=latex_annotated/%A latex_annotated/*.tex | |
- name: Upload pdf output | |
uses: actions/upload-artifact@v3 | |
with: | |
name: pdf-output | |
path: | | |
latex/*.pdf | |
latex_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 |