Skip to content

Commit

Permalink
Automatically compile and release resume
Browse files Browse the repository at this point in the history
  • Loading branch information
nastevens committed Dec 31, 2023
1 parent 96782c0 commit bebb86e
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/compile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Compile resume

on:
push:
workflow_call:
workflow_dispatch:

jobs:
compile:
name: Compile resume to PDF
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
name: Cache tectonic files
with:
path: ~/.cache/Tectonic
key: ${{ runner.os }}-tectonic-${{ hashFiles('**/*.tex') }}
restore-keys: |
${{ runner.os }}-tectonic-
- uses: wtfjoke/setup-tectonic@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- run: tectonic resume.tex
- uses: actions/upload-artifact@v4
with:
name: resume
path: resume.pdf
if-no-files-found: error
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Release latest resume

on:
workflow_dispatch:

jobs:
compile:
uses: ./.github/workflows/compile.yml
getdate:
runs-on: ubuntu-latest
outputs:
date: ${{ steps.getdate.outputs.date }}
steps:
- id: getdate
run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT
release:
runs-on: ubuntu-latest
permissions:
contents: write
needs: [compile, getdate]
env:
OUTPUT_NAME: Resume-Nick_Stevens-${{ needs.getdate.outputs.date }}.pdf
steps:
- uses: actions/download-artifact@v4
with:
name: resume
- name: Rename file to include current date
run: mv resume.pdf "$OUTPUT_NAME"
- name: Create release ${{ needs.getdate.outputs.date }}
uses: ncipollo/release-action@v1
with:
artifacts: ${{ env.OUTPUT_NAME }}
artifactContentType: application/pdf
allowUpdates: true
makeLatest: true
name: ${{ needs.getdate.outputs.date }}
tag: v${{ needs.getdate.outputs.date }}

0 comments on commit bebb86e

Please sign in to comment.