# deploy.R

message("📝 1. Updating package documentation and namespace...")
devtools::document()

message("🚀 2. Running targets pipeline...")
targets::tar_make()

message("🏗️ 3. Building pkgdown website...")
pkgdown::build_site()

message("📦 4. Injecting slides into public docs/ folder...")
# Create target directories
fs::dir_create("docs/slides/reports/figures")

# Copy the HTML and index_files
fs::dir_copy("reports/slides/", "docs/slides/", overwrite = TRUE)

# Copy the figures so the slides can see them
fs::dir_copy("reports/figures/", "docs/slides/reports/figures/", overwrite = TRUE)

message("✅ DONE: Site and slides successfully deployed to docs/")