Skip to content

Commit

Permalink
Update latex.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
htjb authored Jul 22, 2023
1 parent d850754 commit 4a1abc2
Showing 1 changed file with 46 additions and 19 deletions.
65 changes: 46 additions & 19 deletions .github/workflows/latex.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,51 @@
name: Build LaTeX Document
on: [push, pull_request]
name: Build and Deploy LaTeX Project

permissions: write-all

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
test:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v2

- name: Compile LaTeX document
uses: Sakul6499/[email protected]
with:
latex_main_file: CV.tex
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

- name: GIT commit and push PDF
env:
CI_COMMIT_MESSAGE: Continuous Integration Build Artifacts
CI_COMMIT_AUTHOR: Continuous Integration
# Compiles
- name: Build Latex PDF and HTML
run: |
git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}"
git config --global user.email "[email protected]"
git add CV.pdf
git commit -m "${{ env.CI_COMMIT_MESSAGE }}"
git push
sudo apt update
sudo apt install texlive-full
mkdir ./public
cp *.tex public/
cd public/
pdflatex CV.tex
# Uploads the PDF
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: PDF
path: public/CV.pdf

# Publishes the PDF as a release
- name: Publish PDF
uses: softprops/action-gh-release@v1
# if: startsWith(github.ref, 'refs/tags/')
with:
tag_name: Current
files: public/CV.pdf

0 comments on commit 4a1abc2

Please sign in to comment.