11 Commits

Author SHA1 Message Date
1e564636b4 remove debuggings, use date tags
All checks were successful
Build and Publish / build_html (push) Successful in 38s
2025-12-08 22:49:59 -06:00
0e0fcfd26b remove container
All checks were successful
Build and Publish / build_html (push) Successful in 36s
2025-12-08 22:43:33 -06:00
1ddf339172 combine into a single job rather than use artifacts
Some checks failed
Build and Publish / build_html (push) Failing after 1m17s
2025-12-08 22:38:54 -06:00
d4ec88c65d use venv path for weasyprint
Some checks failed
Build and Publish / build_html (push) Successful in 6s
Build and Publish / upload_as_release (push) Successful in 3s
Build and Publish / convert_to_pdf (push) Failing after 29s
2025-12-08 22:31:22 -06:00
d8cb1b8272 Use venvs
Some checks failed
Build and Publish / build_html (push) Successful in 7s
Build and Publish / convert_to_pdf (push) Failing after 26s
Build and Publish / upload_as_release (push) Successful in 2s
2025-12-08 22:29:35 -06:00
43183c3d09 install from pip instead
Some checks failed
Build and Publish / build_html (push) Successful in 6s
Build and Publish / convert_to_pdf (push) Failing after 16s
Build and Publish / upload_as_release (push) Successful in 2s
2025-12-08 22:27:12 -06:00
9f68438dfe split npm commands
Some checks failed
Build and Publish / build_html (push) Successful in 6s
Build and Publish / convert_to_pdf (push) Failing after 43s
Build and Publish / upload_as_release (push) Successful in 3s
2025-12-08 22:23:14 -06:00
fddb3f5c3e Move to weasyprint
Some checks failed
Build and Publish / build_html (push) Failing after 6s
Build and Publish / convert_to_pdf (push) Failing after 44s
Build and Publish / upload_as_release (push) Successful in 2s
2025-12-08 22:22:04 -06:00
82205954cc Add puppeteer to convert to pdf
Some checks failed
Build / Build_And_Publish (push) Failing after 33s
2025-12-08 22:08:17 -06:00
8230ce9319 debug the release part
All checks were successful
Build / Build_And_Publish (push) Successful in 42s
2025-12-08 17:40:39 -06:00
34faab49ff Convert with puppeteer
All checks were successful
Build / Build_And_Publish (push) Successful in 43s
2025-12-08 17:35:33 -06:00
8 changed files with 151 additions and 18 deletions

1
.envrc Normal file
View File

@@ -0,0 +1 @@
use flake

View File

@@ -1,23 +1,43 @@
name: Build name: Build and Publish
run-name: Building latest version of my resume 🚀 run-name: Building latest version of my resume 🚀
on: [push] on: [push]
jobs: jobs:
Build_And_Publish: build_html:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: node:latest
steps: steps:
- name: Check out repository code - name: Check out repository code
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "latest"
- name: Build the resume - name: Build the resume
run: | run: |
npm i npm i
npm run build npm run build
- name: List files in the repository
- name: Install weasyprint
run: | run: |
ls ${{ gitea.workspace }} sudo apt-get update
sudo apt-get install -y python3-venv python3-pip libpango-1.0-0 libpangoft2-1.0-0
python3 -m venv venv
venv/bin/pip install weasyprint
- name: Convert to pdf
run: |
venv/bin/weasyprint generated_resume.html resume.pdf
- name: Generate tag
id: tag
run: echo "tag=resume-$(date +'%Y%m%d-%H%M%S')" >> $GITHUB_OUTPUT
- name: Create Release - name: Create Release
uses: akkuman/gitea-release-action@v1 uses: akkuman/gitea-release-action@v1
with: with:
files: resume.pdf files: |-
resume.pdf
tag_name: ${{ steps.tag.outputs.tag }}
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}

3
.gitignore vendored
View File

@@ -1,2 +1,5 @@
node_modules node_modules
generated_resume.html generated_resume.html
resume.pdf
.direnv

View File

@@ -1,7 +1,7 @@
[ [
{ {
"label": "Build", "label": "Build",
"command": "npm run build", "command": "npm run build && weasyprint generated_resume.html resume.pdf",
"use_new_terminal": false, "use_new_terminal": false,
"allow_concurrent_runs": false, "allow_concurrent_runs": false,
"reveal": "always", "reveal": "always",

View File

@@ -1,20 +1,20 @@
const ejs = require('ejs'); const ejs = require("ejs");
const fs = require('fs'); const fs = require("fs");
const path = require('path'); const path = require("path");
// File paths // File paths
const dataPath = path.join(__dirname, 'content.json'); const dataPath = path.join(__dirname, "content.json");
const templatePath = path.join(__dirname, 'template.ejs'); const templatePath = path.join(__dirname, "template.ejs");
const outputPath = path.join(__dirname, 'generated_resume.html'); const outputPath = path.join(__dirname, "generated_resume.html");
// Read data and template // Read data and template
const jsonData = JSON.parse(fs.readFileSync(dataPath, 'utf-8')); const jsonData = JSON.parse(fs.readFileSync(dataPath, "utf-8"));
const template = fs.readFileSync(templatePath, 'utf-8'); const template = fs.readFileSync(templatePath, "utf-8");
// Render HTML // Render HTML
const html = ejs.render(template, jsonData); const html = ejs.render(template, jsonData);
// Write the output // Write the output
fs.writeFileSync(outputPath, html, 'utf-8'); fs.writeFileSync(outputPath, html, "utf-8");
console.log(`Successfully generated resume at ${outputPath}`); console.log(`Successfully generated html resume at ${outputPath}`);

61
flake.lock generated Normal file
View File

@@ -0,0 +1,61 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1764950072,
"narHash": "sha256-BmPWzogsG2GsXZtlT+MTcAWeDK5hkbGRZTeZNW42fwA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "f61125a668a320878494449750330ca58b78c557",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

47
flake.nix Normal file
View File

@@ -0,0 +1,47 @@
{
description = "Resume builder dev environment";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
{
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
nodejs
python313Packages.weasyprint
jq
curl
just
];
shellHook = ''
export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1
export PUPPETEER_EXECUTABLE_PATH=${pkgs.chromium}/bin/chromium
echo ""
echo "🚀 Resume Build Environment"
echo ""
echo "Node version: $( node -v)"
echo ""
echo "Quick commands:"
echo " just build # Build my resume"
echo ""
'';
};
}
);
}

View File

@@ -4,7 +4,8 @@
"description": "Builds an HTML resume from JSON data", "description": "Builds an HTML resume from JSON data",
"main": "build.js", "main": "build.js",
"scripts": { "scripts": {
"build": "node build.js" "build": "node build.js",
"convert": "weasyprint generated_resume.html resume.pdf"
}, },
"dependencies": { "dependencies": {
"ejs": "^3.1.8" "ejs": "^3.1.8"