Skip to content

Commit

Permalink
Render using this repo's GitHub Action and publish to GitHub Pages
Browse files Browse the repository at this point in the history
  • Loading branch information
kadykov committed Oct 28, 2024
1 parent 665bd3a commit 2f4244f
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"extensions": [
"ms-azuretools.vscode-docker",
"nvarner.typst-lsp",
"skellock.just"
"skellock.just",
"ritwickdey.LiveServer"
]
}
}
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,24 @@ jobs:
tags: kadykov/typst-cv:latest
cache-from: type=registry,ref=kadykov/typst-cv:latest
cache-to: type=inline

render:
name: Render and publish CV
needs: docker
runs-on: ubuntu-latest
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- uses: actions/checkout@v4

- name: Render with TypstCV
uses: kadykov/typstCV@main

- name: Deploy CV to GitHub pages
uses: peaceiris/actions-gh-pages@v4
if: github.ref == 'refs/heads/main'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-added-large-files
Expand Down
7 changes: 7 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
name: 'Typst CV'
description: 'Render PDF files with Typst'
runs:
using: 'docker'
image: 'docker://kadykov/typst-cv:latest'
entrypoint: 'entrypoint.sh'
8 changes: 8 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh -l

set -e
just build
mkdir -p public
cp *.pdf *.html public/
files=$(ls public/)
echo -e "Files in the public folder:\n$files"
18 changes: 18 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<title>CV Aleksandr Kadykov</title>
</head>
<body>
<div style="height: 100vh;">
<object data="/kadykov-cv.pdf" type="application/pdf" width="100%" height="100%">
<p>Unable to display PDF file. <a href="/kadykov-cv.pdf">Download</a> instead.</p>
</object>
</div>
<div style="height: 100vh;">
<object data="/kadykov-letter.pdf" type="application/pdf" width="100%" height="100%">
<p>Unable to display PDF file.<a href="/kadykov-letter.pdf">Download</a> a PDF version.</p>
</object>
</div>
</body>
</html>

0 comments on commit 2f4244f

Please sign in to comment.