CI/CD #23
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: CI/CD | |
on: | |
pull_request: | |
branches: | |
- main | |
paths: | |
- '**.tex' | |
- 'Makefile' | |
- 'requirements.tlmgr.txt' | |
- 'version.txt' | |
push: | |
branches: | |
- main | |
paths: | |
- '**.tex' | |
- 'Makefile' | |
- 'requirements.tlmgr.txt' | |
- 'version.txt' | |
workflow_dispatch: | |
inputs: | |
release: | |
description: 'Create a release' | |
required: true | |
default: false | |
type: boolean | |
jobs: | |
build: | |
# runs-on: ["self-hosted", "resume-runner"] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | |
- name: Compile LaTeX | |
id: compile | |
uses: xu-cheng/latex-action@f1ca82cbed861b3534e2997dd584944f55b884ed # v3 | |
with: | |
pre_compile: "tlmgr update --self && tlmgr install `cat requirements.tlmgr.txt`" | |
root_file: Jonathan_Prentice.Resume.tex | |
- name: Upload PDF | |
uses: actions/upload-artifact@1eb3cb2b3e0f29609092a73eb033bb759a334595 # v4 | |
with: | |
name: resume | |
path: Jonathan_Prentice.Resume.pdf | |
release: | |
if: github.event.inputs.release == 'true' | |
needs: build | |
# runs-on: ["self-hosted", "resume-runner"] | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | |
- name: Download PDF | |
id: download | |
uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4 | |
with: | |
name: resume | |
- name: Read version number | |
id: version | |
run: echo "::set-output name=version::$(cat version.txt)" | |
- name: Create release | |
id: release | |
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v1 | |
with: | |
tag_name: ${{ steps.version.outputs.version }} | |
files: | | |
Jonathan_Prentice.Resume.pdf |