46 lines
1.3 KiB
YAML
46 lines
1.3 KiB
YAML
name: Render and Deploy CV
|
|
|
|
on:
|
|
push:
|
|
branches: ['main']
|
|
paths:
|
|
- 'resume.yaml'
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
render-cv:
|
|
runs-on: python-latest
|
|
steps:
|
|
- name: Install Deploy Tools
|
|
run: |
|
|
apt-get update
|
|
apt-get install -y git rsync openssh-client
|
|
git clone --depth 1 "http://localhost:3000/${{ github.repository }}.git" .
|
|
|
|
- name: Render CV
|
|
run: |
|
|
# Use uvx to run rendercv instantly.
|
|
uvx --with "rendercv[full]" rendercv render resume.yaml
|
|
|
|
# Prepare for rsync
|
|
mkdir -p ./deploy
|
|
find rendercv_output -name "*.pdf" -exec cp {} ./deploy/cv.pdf \;
|
|
|
|
- name: Deploy CV via Rsync
|
|
env:
|
|
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
|
|
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
|
|
REMOTE_USER: ${{ secrets.REMOTE_USER }}
|
|
REMOTE_PORT: ${{ secrets.REMOTE_PORT }}
|
|
run: |
|
|
mkdir -p ~/.ssh
|
|
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_ed25519
|
|
chmod 600 ~/.ssh/id_ed25519
|
|
ssh-keyscan -p "$REMOTE_PORT" "$REMOTE_HOST" >> ~/.ssh/known_hosts
|
|
|
|
# Sync only the PDF
|
|
rsync -avz \
|
|
-e "ssh -p $REMOTE_PORT" \
|
|
./deploy/cv.pdf \
|
|
$REMOTE_USER@$REMOTE_HOST:/var/www/cv.pdf
|