Files
Rob Wiederstein 85bc257e7b
All checks were successful
Deploy Lakehouse Docs / build-and-deploy (push) Successful in 8m44s
Lint & Format Check / Link Check (push) Successful in 3s
Lint & Format Check / Format Check (styler) (push) Successful in 14s
R Package Tests / test (push) Successful in 53s
Rename package from baflakehouse to bankfraud
- DESCRIPTION: Package name and URL updated to /bank-fraud
- R/baflakehouse-package.R → R/bankfraud-package.R
- _pkgdown.yml: url and reference alias updated
- deploy.yaml: TARGET_DIR updated to /var/www/docs/bank-fraud/
- deploy/baflakehouse.caddy: deleted (stale, superseded by rsync workflow)
- tests and README updated

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-23 09:38:54 -05:00

72 lines
2.7 KiB
YAML

name: Deploy Lakehouse Docs
on:
push:
branches:
- main
- master
jobs:
build-and-deploy:
runs-on: ubuntu-latest
container:
# Use the rocker/verse image as it contains R, pandoc, quarto, and many tidyverse dependencies
image: rocker/verse:4.4
steps:
- name: Install Node.js (required for actions/checkout)
run: |
apt-get update -y
apt-get install -y nodejs
- name: Checkout repository
uses: actions/checkout@v3
- name: Install system dependencies
# Install system dependencies required for R packages (xml2, curl, graphics libraries) + rsync/ssh
run: |
apt-get update -y
apt-get install -y \
libcurl4-openssl-dev libssl-dev libxml2-dev libglpk-dev \
libfontconfig1-dev libfreetype6-dev libharfbuzz-dev libfribidi-dev \
libpng-dev libjpeg-dev libtiff-dev libzstd-dev cmake \
rsync openssh-client
- name: Install R package dependencies
# First install 'renv' or 'remotes', then install project dependencies
# Using remotes here as it's typically faster for CI if renv cache isn't available
run: |
Rscript -e "install.packages(c('remotes', 'styler', 'roxygen2'))"
Rscript -e "remotes::install_deps(dependencies = TRUE)"
- name: Run Build Script
# This executes deploy.R which runs styler, devtools::document, targets::tar_make, and pkgdown::build_site
# Note: If tar_make() interacts with MinIO, you MUST provide the BAF_* secrets in Gitea repository settings.
env:
BAF_KEY: ${{ secrets.BAF_KEY }}
BAF_SECRET: ${{ secrets.BAF_SECRET }}
BAF_ENDPOINT: ${{ secrets.BAF_ENDPOINT }}
BAF_BUCKET: ${{ secrets.BAF_BUCKET }}
run: |
Rscript deploy.R
- name: Deploy via Rsync
# Rsync the generated docs/ folder to the host machine.
# This requires setting DEPLOY_SSH_KEY, DEPLOY_SERVER_USER, and DEPLOY_SERVER_IP in Gitea Secrets.
env:
SSH_PRIVATE_KEY: ${{ secrets.DEPLOY_SSH_KEY }}
SERVER_IP: ${{ secrets.DEPLOY_SERVER_IP }}
SERVER_USER: ${{ secrets.DEPLOY_SERVER_USER }}
TARGET_DIR: /var/www/docs/bank-fraud/
run: |
# Setup SSH key
mkdir -p ~/.ssh
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
# Add host to known_hosts to prevent interactive prompt
ssh-keyscan -H $SERVER_IP >> ~/.ssh/known_hosts
# Sync the docs/ directory directly into the Caddy webroot
rsync -avz --delete docs/ ${SERVER_USER}@${SERVER_IP}:${TARGET_DIR}