Skip to content

Commit

Permalink
Add pkgdown
Browse files Browse the repository at this point in the history
  • Loading branch information
juba committed Nov 26, 2020
1 parent ff835c4 commit b9ee5e0
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
^.*\.Rproj$
^\.Rproj\.user$
resources
^\.travis\.yml$
inst/sample_file
\.github/
^\.github$
tools/
^_pkgdown\.yml$
^docs$
^pkgdown$
vignettes/examples
48 changes: 48 additions & 0 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
on:
push:
branches:
- main
- master

name: pkgdown

jobs:
pkgdown:
runs-on: macOS-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@v1

- uses: r-lib/actions/setup-pandoc@v1

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}

- name: Cache R packages
uses: actions/cache@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-

- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
install.packages("pkgdown", type = "binary")
shell: Rscript {0}

- name: Install package
run: R CMD INSTALL .

- name: Deploy package
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Actions"
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@
.Rproj.user
*.Rproj
inst/doc
inst/sample_file/*.html
inst/sample_file/*.html
docs
vignettes/examples/*.html
18 changes: 18 additions & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
url: https://juba.github.io/rmdformats/
template:
params:
bootswatch: cosmo
reference:
- title: Templates
contents:
- '`html_clean`'
- '`html_docco`'
- '`readthedown`'
- '`material`'
- '`robobook`'
- '`downcute`'
- '`lockdown`'
- title: Helpers
contents:
- '`pilltabs`'
- '`print.pilltabs`'

0 comments on commit b9ee5e0

Please sign in to comment.