Skip to content

Commit

Permalink
Add pkgdown to CI jobs.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan-g committed Jul 12, 2024
1 parent 207b6b9 commit 531341e
Show file tree
Hide file tree
Showing 6 changed files with 161 additions and 11 deletions.
22 changes: 17 additions & 5 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
^doc$
^Meta$
^CRAN-RELEASE$
^.*\.Rproj$
^\.Rproj\.user$
^\.travis\.yml$
^\.gitlab-ci\.yml$
^LICENCE$
^LICENSE\.R?md$
^README\.R?md$
^README-.*\.(png|jpg|jpeg|pdf)$
^inst/tests/.*$
^README_files/.*$
^LICENCE$
^LICENSE\.R?md$
^\.travis\.yml$
^\.gitlab-ci\.yml$
^raw_data/.*$
^prep_tools/.*$
^cran-comments\.md$
^\.github$
^_pkgdown\.yml$
^docs$
^pkgdown$
^foo/.*$
^CRAN-SUBMISSION$
^app\.R$
^\.github$
50 changes: 50 additions & 0 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# 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

permissions: read-all

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/[email protected]
with:
clean: false
branch: gh-pages
folder: docs
53 changes: 49 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,54 @@
*.Rproj
#
# RStudio project files
#
.Rproj.user/
*.Rproj

#
# R files
#
.Rhistory
.RData
.Ruserdata
~*.xls*
~*.doc*
.Rproj.user

#
# R package generated files
#
inst/doc
docs/
doc
Meta

#
# Backup files
#
*.bak

#
# LaTeX files
#
*.aux
*.bbl
*.glo
*.gls
*.glg
*.idx
*.ilg
*.lof
*.log
*.lot
*.toc
*.out
*.synctex.gz

#
# Office temp files
#
~$*
*~
*.tmp

/foo/
/CRAN-RELEASE
/doc/
/Meta/
3 changes: 2 additions & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ gh_url <- httr::build_url(purl)
<!-- badges: start -->
[![CRAN Status Badge](https://www.r-pkg.org/badges/version-last-release/kayaExplorer)](https://cran.r-project.org/package=kayaExplorer)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![R-CMD-check](https://github.com/jonathan-g/kaya-explorer/workflows/R-CMD-check/badge.svg)](https://github.com/jonathan-g/kayaExplorer/actions)
[![R-CMD-check](https://github.com/jonathan-g/kaya-explorer/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/jonathan-g/kaya-explorer/actions/workflows/R-CMD-check.yaml)
[![pkgdown](https://github.com/jonathan-g/kaya-explorer/actions/workflows/pkgdown.yaml/badge.svg)](https://github.com/jonathan-g/kaya-explorer/actions/workflows/pkgdown.yaml)
**GitLab:** [![Build Status](https://gitlab.jgilligan.org/gilligan_teaching/ees_3310/ees_3310_software/kaya-explorer/badges/main/build.svg)](https://gitlab.jgilligan.org/gilligan_teaching/ees_3310/ees_3310_software/kaya-explorer/commits/main)
<!-- badges: end -->

Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
Badge](https://www.r-pkg.org/badges/version-last-release/kayaExplorer)](https://cran.r-project.org/package=kayaExplorer)
[![License:
MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![R-CMD-check](https://github.com/jonathan-g/kaya-explorer/workflows/R-CMD-check/badge.svg)](https://github.com/jonathan-g/kayaExplorer/actions)
[![R-CMD-check](https://github.com/jonathan-g/kaya-explorer/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/jonathan-g/kaya-explorer/actions/workflows/R-CMD-check.yaml)
[![pkgdown](https://github.com/jonathan-g/kaya-explorer/actions/workflows/pkgdown.yaml/badge.svg)](https://github.com/jonathan-g/kaya-explorer/actions/workflows/pkgdown.yaml)
**GitLab:** [![Build
Status](https://gitlab.jgilligan.org/gilligan_teaching/ees_3310/ees_3310_software/kaya-explorer/badges/main/build.svg)](https://gitlab.jgilligan.org/gilligan_teaching/ees_3310/ees_3310_software/kaya-explorer/commits/main)
<!-- badges: end -->
Expand Down
41 changes: 41 additions & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
destination: docs
url: https://jonathan-g.github.io/kaya-explorer

home:
title: Kaya Identity Data for Nations and Regions
description: >
A Shiny-based explorer for Kaya identity. Loads data from the kayadata
package and provides an interactive shiny app for exploring the data:
choose a country or region and examine trends in the Kaya variables
(population, gross domestic product, primary energy consumption, and
carbon dioxide emissions), compare historical trends to the implied trends
necessary to hit decarbonization policy targets (e.g., 70% reduction of
emissions by 2050). Also allows the user to explore the fuel mix that
different countries and regions use to supply their energy needs.
strip_header: false

authors:
Jonathan Gilligan:
href: https://www.jonathangilligan.org

development:
mode: auto

reference:
- title: Interactive Shiny app
desc: Interactive app to explore Kaya identity data and its implications for
climate policy.
contents:
- launch_kaya_explorer
- kaya_app
- title: Utility functions
desc: Miscellaneous utility functions
contents:
- set_debug
- c_to_co2
- co2_to_c
- title: internal
contents:
- kayaExplorer-package


0 comments on commit 531341e

Please sign in to comment.