Skip to content

Deploy R Documentation #2

Deploy R Documentation

Deploy R Documentation #2

Workflow file for this run

# 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: Fetch R/ggplot2 docs from plotly.r-docs
run: make fetch
- 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