Skip to content

Commit e70113e

Browse files
cpsievertclaude
andauthored
Add GitHub Actions workflow to deploy R documentation (#2470)
* Add GitHub Actions workflow to deploy R documentation This workflow builds and deploys the R documentation site from the graphing-library-docs repository to this repo's GitHub Pages. The workflow: - Runs weekly (Sundays) to pick up docs changes - Can be triggered manually via workflow_dispatch - Can be triggered via repository_dispatch from the docs repo The docs source lives at cpsievert/graphing-library-docs and includes documentation for both plotly.R and ggplotly. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Try sleeping in shinytest test for relayout size stability --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 73bd179 commit e70113e

File tree

2 files changed

+84
-0
lines changed

2 files changed

+84
-0
lines changed

.github/workflows/docs.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Add this file to plotly/plotly.R at .github/workflows/docs.yml
2+
#
3+
# This workflow builds and deploys the R documentation site from
4+
# the graphing-library-docs repository to this repo's GitHub Pages.
5+
6+
name: Deploy R Documentation
7+
8+
on:
9+
# Manual trigger
10+
workflow_dispatch:
11+
12+
# Run weekly to pick up any docs changes
13+
schedule:
14+
- cron: '0 0 * * 0' # Every Sunday at midnight UTC
15+
16+
# Optional: trigger from docs repo via repository_dispatch
17+
repository_dispatch:
18+
types: [docs-updated]
19+
20+
# Sets permissions for GitHub Pages deployment
21+
permissions:
22+
contents: read
23+
pages: write
24+
id-token: write
25+
26+
# Allow only one concurrent deployment
27+
concurrency:
28+
group: "pages"
29+
cancel-in-progress: false
30+
31+
env:
32+
# Change this if the docs repo moves to a different location
33+
DOCS_REPO: cpsievert/graphing-library-docs
34+
DOCS_BRANCH: master
35+
36+
jobs:
37+
build:
38+
runs-on: ubuntu-latest
39+
steps:
40+
- name: Checkout docs repository
41+
uses: actions/checkout@v4
42+
with:
43+
repository: ${{ env.DOCS_REPO }}
44+
ref: ${{ env.DOCS_BRANCH }}
45+
46+
- name: Setup Ruby
47+
uses: ruby/setup-ruby@v1
48+
with:
49+
ruby-version: '2.7.4'
50+
bundler-cache: true
51+
52+
- name: Setup Python
53+
uses: actions/setup-python@v5
54+
with:
55+
python-version: '3.11'
56+
57+
- name: Fetch R/ggplot2 docs from plotly.r-docs
58+
run: make fetch
59+
60+
- name: Validate front-matter
61+
run: python front-matter-ci.py _posts
62+
63+
- name: Build site
64+
run: bundle exec jekyll build
65+
env:
66+
JEKYLL_ENV: production
67+
68+
- name: Upload artifact
69+
uses: actions/upload-pages-artifact@v3
70+
with:
71+
path: _site
72+
73+
deploy:
74+
environment:
75+
name: github-pages
76+
url: ${{ steps.deployment.outputs.page_url }}
77+
runs-on: ubuntu-latest
78+
needs: build
79+
steps:
80+
- name: Deploy to GitHub Pages
81+
id: deployment
82+
uses: actions/deploy-pages@v4

inst/examples/shiny/event_data/tests/testthat/test-shinytest2.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ test_that("Plotly input values in Shiny", {
2121
app$set_inputs(`plotly_brushed-A` = "{\"x\":[23.95978500551268,25.98332414553473],\"y\":[3.0020072289156627,3.5073743975903615]}", allow_no_input_binding_ = TRUE)
2222
app$set_inputs(`plotly_hover-A` = "[{\"curveNumber\":0,\"pointNumber\":7,\"x\":24.4,\"y\":3.19,\"customdata\":\"Merc 240D\"}]", allow_no_input_binding_ = TRUE)
2323
app$set_inputs(`plotly_hover-A` = character(0), allow_no_input_binding_ = TRUE)
24+
Sys.sleep(1)
2425
app$expect_values()
2526
app$set_inputs(`plotly_selected-A` = character(0), allow_no_input_binding_ = TRUE)
2627
app$set_inputs(`plotly_brushed-A` = character(0), allow_no_input_binding_ = TRUE)
@@ -30,5 +31,6 @@ test_that("Plotly input values in Shiny", {
3031
app$set_inputs(`plotly_brushing-A` = character(0), allow_no_input_binding_ = TRUE)
3132
app$set_inputs(`plotly_click-A` = character(0), allow_no_input_binding_ = TRUE)
3233
app$set_inputs(`plotly_deselect-A` = "\"plot\"", allow_no_input_binding_ = TRUE)
34+
Sys.sleep(1)
3335
app$expect_values()
3436
})

0 commit comments

Comments
 (0)