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
82 changes: 82 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Add this file to plotly/plotly.R at .github/workflows/docs.yml
#
# This workflow builds and deploys the R documentation site from
# the graphing-library-docs repository to this repo's GitHub Pages.

name: Deploy R Documentation

on:
# Manual trigger
workflow_dispatch:

# Run weekly to pick up any docs changes
schedule:
- cron: '0 0 * * 0' # Every Sunday at midnight UTC

# Optional: trigger from docs repo via repository_dispatch
repository_dispatch:
types: [docs-updated]

# Sets permissions for GitHub Pages deployment
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: false

env:
# Change this if the docs repo moves to a different location
DOCS_REPO: cpsievert/graphing-library-docs
DOCS_BRANCH: master

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout docs repository
uses: actions/checkout@v4
with:
repository: ${{ env.DOCS_REPO }}
ref: ${{ env.DOCS_BRANCH }}

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7.4'
bundler-cache: true

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Fetch R/ggplot2 docs from plotly.r-docs
run: make fetch

- name: Validate front-matter
run: python front-matter-ci.py _posts

- name: Build site
run: bundle exec jekyll build
env:
JEKYLL_ENV: production

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

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
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ test_that("Plotly input values in Shiny", {
app$set_inputs(`plotly_brushed-A` = "{\"x\":[23.95978500551268,25.98332414553473],\"y\":[3.0020072289156627,3.5073743975903615]}", allow_no_input_binding_ = TRUE)
app$set_inputs(`plotly_hover-A` = "[{\"curveNumber\":0,\"pointNumber\":7,\"x\":24.4,\"y\":3.19,\"customdata\":\"Merc 240D\"}]", allow_no_input_binding_ = TRUE)
app$set_inputs(`plotly_hover-A` = character(0), allow_no_input_binding_ = TRUE)
Sys.sleep(1)
app$expect_values()
app$set_inputs(`plotly_selected-A` = character(0), allow_no_input_binding_ = TRUE)
app$set_inputs(`plotly_brushed-A` = character(0), allow_no_input_binding_ = TRUE)
Expand All @@ -30,5 +31,6 @@ test_that("Plotly input values in Shiny", {
app$set_inputs(`plotly_brushing-A` = character(0), allow_no_input_binding_ = TRUE)
app$set_inputs(`plotly_click-A` = character(0), allow_no_input_binding_ = TRUE)
app$set_inputs(`plotly_deselect-A` = "\"plot\"", allow_no_input_binding_ = TRUE)
Sys.sleep(1)
app$expect_values()
})