Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Build docs in CI #157

Merged
merged 19 commits into from
Jan 9, 2025
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
59 changes: 59 additions & 0 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Build Docs

on:
workflow_dispatch:
push:
branches: ["main", "docs**"]
pull_request:

permissions:
contents: write

concurrency:
group: build-site-${{ github.ref_name }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || !startsWith(github.head_ref, 'docs')

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22 # jsdoc2md 4.0.1 doesn't work with node 23

- name: Install dependencies
run: npm install

- name: Install pandoc
uses: r-lib/actions/setup-pandoc@v2

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

- name: Install R Dependencies
uses: r-lib/actions/setup-r-dependencies@v2
with:
cache-version: 2
extra-packages: |
local::.
needs: |
website

- name: Render docs website
working-directory: docs
run: source build-site.sh

- name: Commit changes
run: |
git config --global user.name "$GITHUB_ACTOR"
git config --global user.email "$GITHUB_ACTOR@users.noreply.github.com"
git add docs/ && git commit -m "ci(docs): Automated site build" || echo "No doc changes"
git push || echo "No doc updates to push"
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ Suggests:
testthat (>= 2.1.0),
sass,
bslib
Config/Needs/website: jcheng5/d3scatter, DT, leaflet, rmarkdown
URL: https://rstudio.github.io/crosstalk/, https://github.com/rstudio/crosstalk
BugReports: https://github.com/rstudio/crosstalk/issues
RoxygenNote: 7.2.3
RoxygenNote: 7.3.2
Encoding: UTF-8
Loading