-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #249
- Loading branch information
Showing
5 changed files
with
103 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,42 @@ | ||
# 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: master | ||
branches: [main, master] | ||
pull_request: | ||
branches: [main, master] | ||
release: | ||
types: [published] | ||
workflow_dispatch: | ||
|
||
name: pkgdown | ||
|
||
jobs: | ||
pkgdown: | ||
runs-on: macOS-latest | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: r-lib/actions/setup-r@master | ||
- uses: r-lib/actions/setup-pandoc@v2 | ||
|
||
- uses: r-lib/actions/setup-pandoc@master | ||
|
||
- 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@v1 | ||
- uses: r-lib/actions/setup-r@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- | ||
use-public-rspm: true | ||
|
||
- name: Install dependencies | ||
run: | | ||
remotes::install_deps(dependencies = TRUE) | ||
install.packages("pkgdown") | ||
remotes::install_github("tidyverse/tidytemplate") | ||
shell: Rscript {0} | ||
- uses: r-lib/actions/setup-r-dependencies@v2 | ||
with: | ||
extra-packages: any::pkgdown, local::. | ||
needs: website | ||
|
||
- name: Install package | ||
run: R CMD INSTALL . | ||
- name: Build site | ||
run: Rscript -e 'pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)' | ||
|
||
- name: Deploy package | ||
run: | | ||
git config --local user.email "actions@github.com" | ||
git config --local user.name "GitHub Actions" | ||
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)' | ||
- name: Deploy to GitHub pages 🚀 | ||
if: github.event_name != 'pull_request' | ||
uses: JamesIves/github-pages-deploy-action@4.1.4 | ||
with: | ||
clean: false | ||
branch: gh-pages | ||
folder: docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,76 @@ | ||
# 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: | ||
issue_comment: | ||
types: [created] | ||
|
||
name: Commands | ||
|
||
jobs: | ||
document: | ||
if: startsWith(github.event.comment.body, '/document') | ||
if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/document') }} | ||
name: document | ||
runs-on: macOS-latest | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: r-lib/actions/pr-fetch@master | ||
|
||
- uses: r-lib/actions/pr-fetch@v2 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: r-lib/actions/setup-r@master | ||
- name: Install dependencies | ||
run: Rscript -e 'install.packages(c("remotes", "roxygen2"))' -e 'remotes::install_deps(dependencies = TRUE)' | ||
|
||
- uses: r-lib/actions/setup-r@v2 | ||
with: | ||
use-public-rspm: true | ||
|
||
- uses: r-lib/actions/setup-r-dependencies@v2 | ||
with: | ||
extra-packages: any::roxygen2 | ||
needs: pr-document | ||
|
||
- name: Document | ||
run: Rscript -e 'roxygen2::roxygenise()' | ||
|
||
- name: commit | ||
run: | | ||
git config --local user.email "actions@github.com" | ||
git config --local user.name "GitHub Actions" | ||
git config --local user.name "$GITHUB_ACTOR" | ||
git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com" | ||
git add man/\* NAMESPACE | ||
git commit -m 'Document' | ||
- uses: r-lib/actions/pr-push@master | ||
- uses: r-lib/actions/pr-push@v2 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
style: | ||
if: startsWith(github.event.comment.body, '/style') | ||
if: ${{ github.event.issue.pull_request && (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER') && startsWith(github.event.comment.body, '/style') }} | ||
name: style | ||
runs-on: macOS-latest | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: r-lib/actions/pr-fetch@master | ||
|
||
- uses: r-lib/actions/pr-fetch@v2 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: r-lib/actions/setup-r@master | ||
|
||
- uses: r-lib/actions/setup-r@v2 | ||
|
||
- name: Install dependencies | ||
run: Rscript -e 'install.packages("styler")' | ||
|
||
- name: Style | ||
run: Rscript -e 'styler::style_pkg()' | ||
|
||
- name: commit | ||
run: | | ||
git config --local user.email "actions@github.com" | ||
git config --local user.name "GitHub Actions" | ||
git config --local user.name "$GITHUB_ACTOR" | ||
git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com" | ||
git add \*.R | ||
git commit -m 'Style' | ||
- uses: r-lib/actions/pr-push@master | ||
- uses: r-lib/actions/pr-push@v2 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters