Skip to content

Commit 0f8c60d

Browse files
cpsievertclaude
andcommitted
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>
1 parent 73bd179 commit 0f8c60d

File tree

1 file changed

+79
-0
lines changed

1 file changed

+79
-0
lines changed

.github/workflows/docs.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
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: '3.1'
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: Validate front-matter
58+
run: python front-matter-ci.py _posts
59+
60+
- name: Build site
61+
run: bundle exec jekyll build
62+
env:
63+
JEKYLL_ENV: production
64+
65+
- name: Upload artifact
66+
uses: actions/upload-pages-artifact@v3
67+
with:
68+
path: _site
69+
70+
deploy:
71+
environment:
72+
name: github-pages
73+
url: ${{ steps.deployment.outputs.page_url }}
74+
runs-on: ubuntu-latest
75+
needs: build
76+
steps:
77+
- name: Deploy to GitHub Pages
78+
id: deployment
79+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)