Separate build and deploy for creating a PDF such that a new branch r… #15
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: Create PDF | |
on: | |
push: | |
branches: [ main, drafting ] | |
pull_request: | |
branches: [ main, drafting ] | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.head_ref }} | |
- name: Build | |
uses: xu-cheng/latex-action@v3 | |
with: | |
root_file: cv.tex | |
working_directory: cv | |
- name: Upload | |
uses: actions/upload-artifact@v4 | |
with: | |
name: cv | |
path: cv/cv.pdf | |
compression-level: 0 # don't compress PDF | |
deploy: | |
runs-on: ubuntu-latest | |
needs: build | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- name: Tag | |
id: generate_release_tag | |
uses: amitsingh-007/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
tag_prefix: 'v' | |
tag_template: 'yyyy.mm.dd.i' | |
- name: Release | |
uses: ncipollo/release-action@v1 | |
with: | |
tag: ${{ steps.generate_release_tag.outputs.next_release_tag }} | |
artifacts: "cv/cv.pdf" | |
generateReleaseNotes: true |