Skip to content

Commit

Permalink
Update GH actions
Browse files Browse the repository at this point in the history
  • Loading branch information
lcreteig committed Feb 19, 2024
1 parent 9d3ce07 commit c4ba341
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 71 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# 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]

name: R-CMD-check

jobs:
R-CMD-check:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
30 changes: 0 additions & 30 deletions .github/workflows/check-release.yaml

This file was deleted.

70 changes: 31 additions & 39 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -1,60 +1,52 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
on:
push:
branches:
- main
- master
branches: [main, master]
pull_request:
branches: [main, master]
release:
types: [published]
workflow_dispatch:

name: docs

jobs:
pkgdown:
runs-on: macOS-latest
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@v2
with:
persist-credentials: false # add for deployment to work correctly

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

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

- uses: r-lib/actions/setup-tinytex@v1 # add tinytex to render pdf output
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- 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}
- uses: r-lib/actions/setup-tinytex@v2 # add tinytex to render pdf output

- name: Cache R packages
uses: actions/cache@v2
- uses: r-lib/actions/setup-r-dependencies@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 .
extra-packages: any::pkgdown, local::.
needs: website

- name: Build site # build pkgdown site in separate step
run: Rscript -e 'pkgdown::build_site()'
- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = TRUE)
shell: Rscript {0}

- name: Render output samples # then render the output samples
run: Rscript R/_render.R

- name: Deploy # deploy the docs folder to gh-pages
uses: JamesIves/[email protected]
- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: docs
CLEAN: true
clean: false
branch: gh-pages
folder: docs
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ knitr::opts_chunk$set(
# amsterdown <img src="man/figures/logo.png" align="right" width="120" />

<!-- badges: start -->
[![R-CMD-check](https://github.com/lcreteig/amsterdown/workflows/R-CMD-check/badge.svg)](https://github.com/lcreteig/amsterdown/actions)
[![R-CMD-check](https://github.com/lcreteig/amsterdown/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/lcreteig/amsterdown/actions/workflows/R-CMD-check.yaml)
[![docs](https://github.com/lcreteig/amsterdown/workflows/docs/badge.svg)](https://github.com/lcreteig/amsterdown/actions)
[![Lifecycle: maturing](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://www.tidyverse.org/lifecycle/#maturing)
[![Launch Rstudio Binder](http://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/lcreteig/amsterdown/master?urlpath=rstudio)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<!-- badges: start -->

[![R-CMD-check](https://github.com/lcreteig/amsterdown/workflows/R-CMD-check/badge.svg)](https://github.com/lcreteig/amsterdown/actions)
[![R-CMD-check](https://github.com/lcreteig/amsterdown/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/lcreteig/amsterdown/actions/workflows/R-CMD-check.yaml)
[![docs](https://github.com/lcreteig/amsterdown/workflows/docs/badge.svg)](https://github.com/lcreteig/amsterdown/actions)
[![Lifecycle:
maturing](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://www.tidyverse.org/lifecycle/#maturing)
Expand Down

0 comments on commit c4ba341

Please sign in to comment.