From 2f4244f789c32d2c2139bbea18fa932b507693ab Mon Sep 17 00:00:00 2001 From: Aleksandr Kadykov Date: Mon, 28 Oct 2024 20:58:25 +0000 Subject: [PATCH] Render using this repo's GitHub Action and publish to GitHub Pages --- .devcontainer/devcontainer.json | 3 ++- .github/workflows/ci.yml | 21 +++++++++++++++++++++ .pre-commit-config.yaml | 2 ++ action.yml | 7 +++++++ entrypoint.sh | 8 ++++++++ index.html | 18 ++++++++++++++++++ 6 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 action.yml create mode 100755 entrypoint.sh create mode 100644 index.html diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 95409fc..c8be25f 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -20,7 +20,8 @@ "extensions": [ "ms-azuretools.vscode-docker", "nvarner.typst-lsp", - "skellock.just" + "skellock.just", + "ritwickdey.LiveServer" ] } } diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4e7e616..4ea8563 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9dbf937..3d27d0d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..284e527 --- /dev/null +++ b/action.yml @@ -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' diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100755 index 0000000..06bbd39 --- /dev/null +++ b/entrypoint.sh @@ -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" diff --git a/index.html b/index.html new file mode 100644 index 0000000..5a90b8e --- /dev/null +++ b/index.html @@ -0,0 +1,18 @@ + + + + CV Aleksandr Kadykov + + +
+ +

Unable to display PDF file. Download instead.

+
+
+
+ +

Unable to display PDF file.Download a PDF version.

+
+
+ +