update: main with develop (#8) #36
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
# Converts latex acronym format to a rough markdown template for easier viewing | |
name: Markdown Acronym Workflow | |
on: | |
push: | |
branches: | |
- main | |
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 . | |
git diff-index --quiet HEAD || git commit -m "update markdown acronyms" # commit to the repository (ignore if no modification) | |
git push # push to remote branch |