Skip to content

Generate PDF

Generate PDF #9

Workflow file for this run

name: Generate PDF
on:
workflow_dispatch:
push:
paths:
- 'tex/**'
tags:
- '**'
pull_request:
paths:
- 'tex/**'
workflow_run:
workflows: ["Tag"]
types:
- completed
env:
PDF_NAME: Alicia-Sykes-CV.pdf
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 📥 Checkout repository
uses: actions/checkout@v2
- name: 🐍 Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: 📦 Install dependencies
run: |
python -m pip install --upgrade pip
cd lib && pip install -r requirements.txt
- name: 📝 Install LaTeX
run: |
sudo apt-get update
sudo apt-get install -y texlive-full latexmk
- name: 📄 Generate PDF
run: make
- name: 📤 Upload PDF artifact
uses: actions/upload-artifact@v2
with:
name: resume-pdf
path: out/${{ env.PDF_NAME }}
release:
needs: build
runs-on: ubuntu-latest
if: |
github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') ||
github.event_name == 'workflow_run' && startsWith(github.event.workflow_run.conclusion, 'success')
steps:
- name: 📥 Checkout repository
uses: actions/checkout@v2
- name: 🏷️ Determine Tag Name
id: determine_tag
run: |
if [ "${{ github.event_name }}" = "workflow_run" ]; then
echo "TAG_NAME=${{ github.event.workflow_run.outputs.new_tag }}" >> $GITHUB_ENV
else
echo "TAG_NAME=${{ github.ref }}" >> $GITHUB_ENV
fi
echo "Determined TAG_NAME=${{ env.TAG_NAME }}"
- name: 📤 Download PDF artifact
uses: actions/download-artifact@v2
with:
name: resume-pdf
path: out/
- name: 📄 Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN || secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.TAG_NAME }}
release_name: Release ${{ env.TAG_NAME }}
body: "Generated CV PDF for release ${{ env.TAG_NAME }}"
draft: true
prerelease: false
- name: 📤 Upload PDF to Release
uses: softprops/action-gh-release@v1
with:
files: out/${{ env.PDF_NAME }}
token: ${{ secrets.BOT_TOKEN }}