70 lines
1.8 KiB
YAML
70 lines
1.8 KiB
YAML
name: Build Jekyll site
|
|
|
|
on:
|
|
push:
|
|
branches: ["main"]
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: pages
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: ruby:3.1
|
|
env:
|
|
JEKYLL_ENV: production
|
|
steps:
|
|
- name: Install Node and LaTeX
|
|
run: |
|
|
apt-get update
|
|
apt-get install -y --no-install-recommends \
|
|
nodejs latexmk texlive-latex-recommended texlive-latex-extra \
|
|
texlive-fonts-recommended texlive-fonts-extra texlive-xetex \
|
|
texlive-plain-generic
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Build CV PDF from LaTeX
|
|
working-directory: cv
|
|
run: latexmk -pdf -interaction=nonstopmode -halt-on-error WJ-CV.tex
|
|
|
|
- name: Install gems
|
|
run: bundle install --jobs 4
|
|
|
|
- name: Build with Jekyll
|
|
run: bundle exec jekyll build
|
|
|
|
- name: Upload site artifact
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: site
|
|
path: _site
|
|
|
|
deploy:
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: debian:stable-slim
|
|
steps:
|
|
- name: Install tools
|
|
run: apt-get update && apt-get install -y --no-install-recommends rsync nodejs openssh-client ca-certificates
|
|
|
|
- name: Download site
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: site
|
|
path: _site
|
|
|
|
- name: Set up SSH
|
|
run: |
|
|
mkdir -p ~/.ssh
|
|
echo "${{ secrets.DEPLOY_SSH_KEY }}" > ~/.ssh/id_ed25519
|
|
chmod 600 ~/.ssh/id_ed25519
|
|
ssh-keyscan -H ${{ secrets.DEPLOY_HOST }} >> ~/.ssh/known_hosts
|
|
|
|
- name: Rsync to VPS
|
|
run: rsync -avz _site/ ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }}:${{ secrets.DEPLOY_PATH }}/ |