Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/workflows/deploy-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["main", "master"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup R
uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- name: Setup dependencies
uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::pkgdown, local::.
needs: website

- name: Build pkgdown site
run: |
pkgdown::build_site()
shell: Rscript {0}

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./docs

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
48 changes: 0 additions & 48 deletions .github/workflows/pkgdown.yaml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,4 @@ rsconnect/
# build artifacts
*.o
*.so
.DS_Store
Empty file added .nojekyll
Empty file.
152 changes: 152 additions & 0 deletions DEPLOYMENT_GUIDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
# 📚 GitHub Pages Deployment Guide for splikit

## Overview
This guide will help you deploy the pkgdown documentation site to GitHub Pages.

## 🚀 Deployment Steps

### Step 1: Push Changes to GitHub
```bash
# Add all changes
git add .

# Commit (if you haven't already)
git commit -m "Ready for pkgdown deployment"

# Push to your branch
git push origin version_2

# If version_2 is not your default branch, merge to main
git checkout main
git merge version_2
git push origin main
```

### Step 2: Enable GitHub Actions (if not already enabled)
1. Go to your repository: https://github.com/Arshammik/splikit
2. Click on **Actions** tab
3. If prompted, enable GitHub Actions for the repository

### Step 3: Configure GitHub Pages
1. Go to **Settings** → **Pages** (left sidebar)
2. Under **Source**, select: **Deploy from a branch**
3. Under **Branch**, select: **gh-pages**
4. Under **Folder**, select: **/ (root)**
5. Click **Save**

### Step 4: Trigger the Build
The pkgdown site will build automatically when you:
- Push to main/master branch
- Create a release
- Manually trigger (Actions tab → pkgdown → Run workflow)

To manually trigger:
1. Go to **Actions** tab
2. Select **pkgdown** workflow
3. Click **Run workflow** → **Run workflow**

### Step 5: Monitor the Build
1. Go to **Actions** tab
2. Click on the running workflow
3. Watch the progress (takes 3-5 minutes)
4. ✅ Green checkmark = Success!

### Step 6: Access Your Site
Once deployed, your site will be available at:
**https://arshammik.github.io/splikit/**

First deployment may take 5-10 minutes to become visible.

## 🔧 Troubleshooting

### If the build fails:
1. Check the Actions tab for error messages
2. Common issues:
- **"No such file or directory"**: The .nojekyll file should fix this
- **"Articles not found"**: We've removed articles section
- **"Package won't install"**: Check DESCRIPTION dependencies

### If the site doesn't appear:
1. Check Settings → Pages to ensure it's enabled
2. Wait 10 minutes (first deployment can be slow)
3. Try: https://arshammik.github.io/splikit/index.html
4. Clear browser cache (Ctrl+Shift+R or Cmd+Shift+R)

### To rebuild the site:
```bash
# Make changes to documentation
# Then commit and push
git add .
git commit -m "Update documentation"
git push origin main

# The GitHub Action will automatically rebuild
```

## 📁 File Structure

Your repository now has:
```
splikit/
├── .github/
│ └── workflows/
│ └── pkgdown.yaml # Builds and deploys site
├── _pkgdown.yml # Site configuration
├── .nojekyll # Prevents Jekyll processing
├── docs/ # Will contain built site (on gh-pages branch)
└── vignettes/ # Your documentation
```

## 🎨 Customization

To customize the site appearance, edit `_pkgdown.yml`:
```yaml
template:
bootstrap: 5
bootswatch: cosmo # Try: cerulean, cosmo, flatly, journal, etc.
theme: github-light # or github-dark
```

## 📋 Checklist

- [ ] Push all changes to GitHub
- [ ] GitHub Actions is enabled
- [ ] pkgdown workflow runs successfully
- [ ] GitHub Pages is configured for gh-pages branch
- [ ] Site is accessible at https://arshammik.github.io/splikit/

## 🔗 Useful Links

- **Your Site**: https://arshammik.github.io/splikit/
- **Repository**: https://github.com/Arshammik/splikit
- **Actions**: https://github.com/Arshammik/splikit/actions
- **Settings**: https://github.com/Arshammik/splikit/settings/pages

## 💡 Tips

1. **Local Preview**: Build locally before pushing
```r
pkgdown::build_site()
# Open docs/index.html in browser
```

2. **Update Only Reference**: For quick updates
```r
pkgdown::build_reference()
```

3. **Check Configuration**:
```r
pkgdown::check_pkgdown()
```

## 📝 Notes

- The site rebuilds automatically on every push to main
- The gh-pages branch is managed automatically by GitHub Actions
- Don't edit the gh-pages branch directly
- The .nojekyll file ensures proper deployment without Jekyll

---

Good luck with your deployment! 🎉
102 changes: 102 additions & 0 deletions GITHUB_PAGES_FIX.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# 🔧 GitHub Pages Configuration Fix

## The Problem
Your repository has conflicting GitHub Pages workflows:
1. Default Jekyll workflow (causing the error)
2. Our pkgdown workflow (what we want)

## ✅ Solution Steps

### Step 1: Disable Jekyll Workflow
1. Go to: https://github.com/Arshammik/splikit/settings/pages
2. Under **Build and deployment**:
- Change from: **Deploy from a branch**
- Change to: **GitHub Actions**
3. Save changes

### Step 2: Push Changes
```bash
git push origin version_2
```

### Step 3: Monitor Deployment
1. Go to: https://github.com/Arshammik/splikit/actions
2. You should see "Deploy static content to Pages" workflow
3. Wait for green checkmark (3-5 minutes)

### Step 4: Verify Site
Visit: https://arshammik.github.io/splikit/

## 🎯 What Changed

### Old Setup (Causing Errors):
```
GitHub Pages → Jekyll → Try to build from docs/ → FAIL (no Jekyll files)
```

### New Setup (Fixed):
```
GitHub Actions → Build pkgdown → Upload artifact → Deploy to Pages → SUCCESS
```

## 📝 Key Files

1. **`.github/workflows/deploy-pages.yml`**: New workflow using GitHub Pages Action
2. **`.nojekyll`**: Tells GitHub not to use Jekyll
3. **`docs/.nojekyll`**: Additional safety to prevent Jekyll
4. **`_pkgdown.yml`**: Clean configuration without articles

## 🚨 Important Settings Change

**You MUST change the GitHub Pages source from "Deploy from a branch" to "GitHub Actions"**

This is done in:
Settings → Pages → Build and deployment → Source → **GitHub Actions**

## 🔍 How to Verify It's Working

After deployment, check:
1. No Jekyll errors in Actions tab
2. Site loads at https://arshammik.github.io/splikit/
3. Logo appears correctly sized
4. All function documentation is accessible

## 📊 Expected Workflow Output

The "Deploy static content to Pages" workflow should show:
- ✅ Checkout
- ✅ Setup R
- ✅ Setup dependencies
- ✅ Build pkgdown site
- ✅ Upload artifact
- ✅ Deploy to GitHub Pages

## 🛠️ If Issues Persist

1. **Clear GitHub Pages cache**:
- Settings → Pages → ... → Unpublish site
- Wait 5 minutes
- Re-enable with GitHub Actions source

2. **Force rebuild**:
```bash
git commit --allow-empty -m "Trigger rebuild"
git push origin version_2
```

3. **Check workflow permissions**:
- Settings → Actions → General
- Workflow permissions: Read and write permissions
- Allow GitHub Actions to create and approve pull requests

## ✨ Benefits of This Approach

- No Jekyll processing (faster)
- Direct static site deployment
- Same method used by major R packages
- Automatic artifact caching
- Better error messages

---

This configuration matches what dplyr, ggplot2, and other tidyverse packages use for their documentation sites.
Loading
Loading