Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
m3lixir authored Oct 15, 2024
0 parents commit 7d73790
Show file tree
Hide file tree
Showing 31 changed files with 1,283 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/python
{
"name": "Python 3",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/python:1-3.12-bullseye",
// Use 'onCreateCommand' to run commands after the container is created inside the container:
"onCreateCommand": "pip install --user -r requirements.txt",
// Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions": ["redhat.vscode-yaml", "mathematic.vscode-pdf"]
}
}
}
34 changes: 34 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Release a CV

on:
push:
tags:
- "*" # Any tag pushed to the repository

permissions:
contents: write

jobs:
call_rendercv_workflow:
name: RenderCV
uses: ./.github/workflows/rendercv.yaml

build:
needs: call_rendercv_workflow
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download RenderCV Output
uses: actions/download-artifact@v4
with:
name: RenderCV Output
path: rendercv_output
- name: Release
uses: softprops/action-gh-release@v2
with:
files: |
rendercv_output/*_CV.pdf
rendercv_output/*_CV.tex
generate_release_notes: true
make_latest: true
54 changes: 54 additions & 0 deletions .github/workflows/rendercv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Render a CV

on:
push:
branches:
- main
workflow_call: # to make the workflow triggerable from other workflows (release.yaml)

permissions:
contents: write

jobs:
rendercv:
name: RenderCV
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install RenderCV
run: |
pip install -r requirements.txt
- name: RenderCV
run: |
cd src
cv_file=$(find . -maxdepth 1 -type f -name "*_CV.yaml" | head -n 1)
if [ -z "$cv_file" ]; then
echo "No RenderCV file found!"
exit 1
fi
cd ..
rendercv render src/$cv_file --pdf-path ${cv_file%.yaml}.pdf --markdown-path README.md --latex-path ${cv_file%.yaml}.tex
- name: Upload rendercv_output as an artifact
uses: actions/upload-artifact@v4
with:
name: RenderCV Output
path: rendercv_output
- uses: dorny/paths-filter@v3
id: changes
with:
base: HEAD
filters: |
cv:
- '*_CV.tex'
- 'README.md'
- name: Push the changes
if: steps.changes.outputs.cv == 'true'
run: |
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
git add -A
git commit -m "render the latest CV"
git push
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
__pycache__/
rendercv_output/
22 changes: 22 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Run RenderCV",
"type": "debugpy",
"request": "launch",
"module": "rendercv",
"args": [
"render",
"src/John_Doe_CV.yaml",
"--pdf-path",
"John_Doe_CV.pdf",
"--markdown-path",
"README.md"
]
}
]
}
Binary file added John_Doe_CV.pdf
Binary file not shown.
Loading

0 comments on commit 7d73790

Please sign in to comment.