-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (53 loc) · 1.99 KB
/
md-workflow.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
# Converts latex acronym format to a rough markdown template for easier viewing
name: Markdown Acronym Workflow
on:
push:
branches:
- develop
pull_request:
types: [opened, reopened, edited, synchronize]
workflow_dispatch:
# Runs script and uploads new version if in main for markdown output
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Action
uses: actions/checkout@v4
- name: Import Libraries
run: |
sudo apt-get update
sudo apt-get install -y texlive-base texlive-latex-base texlive-latex-extra texlive-xetex texlive-fonts-recommended texlive-fonts-extra texlive-lang-greek
- name: Run Markdown Script
run: |
rm -f combined-acronyms.md
python utilities/latex_acronyms-to-markdown.py
- name: Upload Markdown Artifact
uses: actions/upload-artifact@v4
# Upload even if it fails to better see issues
if: always()
with:
name: Markdown-Acronyms
path: combined-acronyms.md
- name: Run LaTeX Script
run: bash compile-test.sh
- name: Upload LaTeX Artifact
uses: actions/upload-artifact@v4
# Upload even if it fails to better see issues
if: always()
with:
name: Latex-Acronyms-PDF
path: compile-test.pdf
- name: Extract branch name
shell: bash
run: echo "branch_name=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
- name: Update Files
if: ${{ github.ref != 'refs/heads/main'}}
run: |
git fetch # fetch branches
git config --global user.name 'GitHub Action'
git config --global user.email 'action@github.com'
git add combined-acronyms.md
git add compile-test.pdf
git diff-index --quiet HEAD || git commit -m "update markdown and latex acronym outputs" # commit to the repository (ignore if no modification)
git push # push to remote branch