Compare commits
11 Commits
resume-202
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 1e564636b4 | |||
| 0e0fcfd26b | |||
| 1ddf339172 | |||
| d4ec88c65d | |||
| d8cb1b8272 | |||
| 43183c3d09 | |||
| 9f68438dfe | |||
| fddb3f5c3e | |||
| 82205954cc | |||
| 8230ce9319 | |||
| 34faab49ff |
@@ -1,23 +1,43 @@
|
||||
name: Build
|
||||
name: Build and Publish
|
||||
run-name: Building latest version of my resume 🚀
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
Build_And_Publish:
|
||||
build_html:
|
||||
runs-on: ubuntu-latest
|
||||
container: node:latest
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: "latest"
|
||||
|
||||
- name: Build the resume
|
||||
run: |
|
||||
npm i
|
||||
npm run build
|
||||
- name: List files in the repository
|
||||
|
||||
- name: Install weasyprint
|
||||
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
|
||||
uses: akkuman/gitea-release-action@v1
|
||||
with:
|
||||
files: resume.pdf
|
||||
files: |-
|
||||
resume.pdf
|
||||
tag_name: ${{ steps.tag.outputs.tag }}
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,2 +1,5 @@
|
||||
node_modules
|
||||
generated_resume.html
|
||||
resume.pdf
|
||||
|
||||
.direnv
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[
|
||||
{
|
||||
"label": "Build",
|
||||
"command": "npm run build",
|
||||
"command": "npm run build && weasyprint generated_resume.html resume.pdf",
|
||||
"use_new_terminal": false,
|
||||
"allow_concurrent_runs": false,
|
||||
"reveal": "always",
|
||||
|
||||
20
build.js
20
build.js
@@ -1,20 +1,20 @@
|
||||
const ejs = require('ejs');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const ejs = require("ejs");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
|
||||
// File paths
|
||||
const dataPath = path.join(__dirname, 'content.json');
|
||||
const templatePath = path.join(__dirname, 'template.ejs');
|
||||
const outputPath = path.join(__dirname, 'generated_resume.html');
|
||||
const dataPath = path.join(__dirname, "content.json");
|
||||
const templatePath = path.join(__dirname, "template.ejs");
|
||||
const outputPath = path.join(__dirname, "generated_resume.html");
|
||||
|
||||
// Read data and template
|
||||
const jsonData = JSON.parse(fs.readFileSync(dataPath, 'utf-8'));
|
||||
const template = fs.readFileSync(templatePath, 'utf-8');
|
||||
const jsonData = JSON.parse(fs.readFileSync(dataPath, "utf-8"));
|
||||
const template = fs.readFileSync(templatePath, "utf-8");
|
||||
|
||||
// Render HTML
|
||||
const html = ejs.render(template, jsonData);
|
||||
|
||||
// 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
61
flake.lock
generated
Normal 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
47
flake.nix
Normal 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 "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
|
||||
|
||||
'';
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -4,7 +4,8 @@
|
||||
"description": "Builds an HTML resume from JSON data",
|
||||
"main": "build.js",
|
||||
"scripts": {
|
||||
"build": "node build.js"
|
||||
"build": "node build.js",
|
||||
"convert": "weasyprint generated_resume.html resume.pdf"
|
||||
},
|
||||
"dependencies": {
|
||||
"ejs": "^3.1.8"
|
||||
|
||||
Reference in New Issue
Block a user