liantze / AltaCV

Yet another alternative curriculum vitae/résumé class with LaTeX
Other
1.26k stars 329 forks source link

Add a GitHub action to build the CVs #102

Closed pmiossec closed 1 year ago

pmiossec commented 1 year ago

Maybe it could be a good idea to make easier for others to build there CVs to add a GitHub actions that build the CVs.

You could do it by committing the github action file .github\workflows\docker-image.yml

with the content:

name: Build the CVs

on: workflow_dispatch
jobs:

  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v3
    - name: Build the mmayer CV
      run: docker run --rm -t --user="$(id -u):$(id -g)" --net=none -v "$(pwd):/tmp" leplusorg/latex latexmk -outdir=/tmp -pdf /tmp/mmayer.tex
    - name: Upload CVs pdf
      uses: actions/upload-artifact@v1
      with:
        name: mmayer.pdf
        path: ./mmayer.pdf
    - name: Build the sample CV
      run: docker run --rm -t --user="$(id -u):$(id -g)" --net=none -v "$(pwd):/tmp" leplusorg/latex latexmk -outdir=/tmp -pdf /tmp/sample.tex
    - name: Upload CVs pdf
      uses: actions/upload-artifact@v1
      with:
        name: sample.pdf
        path: ./sample.pdf

It uses this docker image to build the latex files: https://hub.docker.com/r/leplusorg/latex

Then you will be able to trigger the action manually: https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow and get the pdfs as artifacts

That will allows the users to fork and test the generation right away.

pmiossec commented 1 year ago

Another slightly different idea is to let the user select the CV to generate:

name: Build resume

on:
  workflow_dispatch:
    inputs:
      CV:
        type: choice
        description: Resume to build
        options: 
        - mmayer
        - sample

run-name: Build resume ${{ inputs.CV }}
jobs:

  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v3
    - name: Build the Docker image
      run: docker run --rm -t --user="$(id -u):$(id -g)" --net=none -v "$(pwd):/tmp" leplusorg/latex latexmk -outdir=/tmp -pdf /tmp/${{ github.event.inputs.CV }}.tex
    - name: Upload resume pdf
      uses: actions/upload-artifact@v1
      with:
        name: ${{ github.event.inputs.CV }}.pdf
        path: ./${{ github.event.inputs.CV }}.pdf
liantze commented 1 year ago

Currently I consider this out of scope and purpose of this repo; but you're very welcome to fork this repo and add the action! (#61)