From 9ad8ccc3b71a98906d30a176179ce9c7f2daae26 Mon Sep 17 00:00:00 2001 From: Jeffrey Arnold Date: Fri, 9 Feb 2024 12:21:59 -0800 Subject: [PATCH] Add github action for pkgdown (#172) --- .Rbuildignore | 1 + .github/workflows/pkgdown.yaml | 48 ++++++++++++++++++++++++++++++++++ .gitignore | 1 + DESCRIPTION | 2 +- _pkgdown.yml | 38 ++++++++++----------------- 5 files changed, 65 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/pkgdown.yaml diff --git a/.Rbuildignore b/.Rbuildignore index 0acd3b7f..82afb485 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -22,3 +22,4 @@ ^\.pre-commit-config\.yaml$ ^CRAN-SUBMISSION$ ^scripts$ +^pkgdown$ diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml new file mode 100644 index 00000000..a7276e85 --- /dev/null +++ b/.github/workflows/pkgdown.yaml @@ -0,0 +1,48 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +on: + push: + branches: [main, master] + pull_request: + branches: [main, master] + release: + types: [published] + workflow_dispatch: + +name: pkgdown + +jobs: + pkgdown: + runs-on: ubuntu-latest + # Only restrict concurrency for non-PR jobs + concurrency: + group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + + - uses: r-lib/actions/setup-pandoc@v2 + + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::pkgdown, local::. + needs: website + + - name: Build site + run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) + shell: Rscript {0} + + - name: Deploy to GitHub pages 🚀 + if: github.event_name != 'pull_request' + uses: JamesIves/github-pages-deploy-action@v4.5.0 + with: + clean: false + branch: gh-pages + folder: docs diff --git a/.gitignore b/.gitignore index 8cc41d34..ad62f2bb 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ inst/doc README.html revdep *.DS_Store +docs diff --git a/DESCRIPTION b/DESCRIPTION index b80a1175..62184b6a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -52,7 +52,7 @@ Description: Some extra themes, geoms, and scales for 'ggplot2'. 'Excel', and 'The Wall Street Journal', among others. Provides 'geoms' for Tufte's box plot and range frame. License: GPL-2 -URL: https://jrnold.github.io/ggthemes/, https://github.com/jrnold/ggthemes +URL: https://jrnold.github.io/ggthemes/, https://github.com/jrnold/ggthemes, http://jrnold.github.io/ggthemes/ BugReports: https://github.com/jrnold/ggthemes/issues RoxygenNote: 7.3.1 LazyData: true diff --git a/_pkgdown.yml b/_pkgdown.yml index b15f0cfe..221b22a0 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -1,41 +1,30 @@ +url: http://jrnold.github.io/ggthemes/ template: bootstrap: 5 - reference: - title: Themes - contents: - - starts_with("theme_") -- title: "Color Scales" - desc: >- - Provided ggplot2 scales for the `color` (`colour`) aesthetic. - Scales control the details of how data values are translated to visual - properties. + contents: starts_with("theme_") +- title: Color Scales + desc: Provided ggplot2 scales for the `color` (`colour`) aesthetic. Scales control + the details of how data values are translated to visual properties. contents: - starts_with("scale_color_") - starts_with("scale_fill_") - title: Shape Scales - desc: >- - Provided ggplot2 scales for the `shape` aesthetic. - Scales control the details of how data values are translated to visual - properties. - contents: - - starts_with("scale_shape_") + desc: Provided ggplot2 scales for the `shape` aesthetic. Scales control the details + of how data values are translated to visual properties. + contents: starts_with("scale_shape_") - title: Lintetype Scales - desc: >- - Provided ggplot2 scales for the `linetype` aesthetic. - Scales control the details of how data values are translated to visual - properties. - contents: - - starts_with("scale_linetype_") + desc: Provided ggplot2 scales for the `linetype` aesthetic. Scales control the details + of how data values are translated to visual properties. + contents: starts_with("scale_linetype_") - title: Color, Shape, and Linetype Palettes - desc: >- - Color, shape, and linetype palettes. + desc: Color, shape, and linetype palettes. contents: - ends_with("_pal") - palette_pander - title: Geoms and Stats - desc: >- - ggplot2 geom and stat layers. + desc: ggplot2 geom and stat layers. contents: - starts_with("geom_") - starts_with("stat_") @@ -50,3 +39,4 @@ reference: contents: - ggthemes_data - canva_palettes +