Skip to content

Commit

Permalink
Merge pull request #9 from dataheld/add-website
Browse files Browse the repository at this point in the history
Add website
  • Loading branch information
maxheld83 authored Sep 12, 2024
2 parents 97be1f0 + a287122 commit b71bd97
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 10 deletions.
35 changes: 34 additions & 1 deletion .github/workflows/cicd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,20 @@ jobs:
run: |
apt-get update
make ${{ matrix.make_target }}
- name: Upload Pkgdown Website as an Artifact
if: ${{ matrix.make_target == 'pkgdown' }}
uses: actions/upload-artifact@v4
with:
name: "pkgdown website"
path: "docs/"
lint-all:
name: Lint Code Base (Except R)
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
# Full git history is needed to get a proper list of
# Full git history is needed to get a proper list of
# changed files within `super-linter`
fetch-depth: 0
- name: Lint Code Base
Expand All @@ -111,3 +117,30 @@ jobs:
VALIDATE_R: false
VALIDATE_TERRAGRUNT: false
VALIDATE_CHECKOV: false
publish:
name: "Publish pkgdown Website to Cloudflare"
permissions:
contents: read
deployments: write
needs: [
make-all-in-docker,
lint-all
]
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: "pkgdown website"
path: docs/
- name: Display structure of downloaded files
run: ls -R
- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN_PAGES }}
accountId: ${{ vars.CLOUDFLARE_ACCOUNT_ID_HELDEN18DE }}
projectName: elf
directory: docs/
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Authors@R:
)
Description:
Assorted R helpers.
URL: https://github.com/dataheld/elf
URL: https://github.com/dataheld/elf, https://elf.maxheld.de
BugReports: https://github.com/dataheld/elf/issues
License: file LICENSE
Encoding: UTF-8
Expand Down Expand Up @@ -49,3 +49,4 @@ Collate:
'tests.R'
'installed.R'
'options.R'
RoxygenNote: 7.3.2
2 changes: 1 addition & 1 deletion R/dependencies.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#' @inheritDotParams rlang::check_installed
#' @example inst/examples/dependencies/is_installed2/missing.R
#' @example inst/examples/dependencies/is_installed2/present.R
#' @keywords dependencies helper
#' @family dependencies helper
#' @export
is_installed2 <- function(...) {
if (rlang::is_installed(...)) {
Expand Down
5 changes: 3 additions & 2 deletions R/examples.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
#' manual collation instructions via `#' @include foo.R` may be neeeded,
#' but that will quickly make the package unwieldy.
#' @inheritParams fs::path_package
#' @keywords path helpers, example helpers
#' @family path helpers
#' @family example helpers
#' @export
source_pef <- function(package, ...) {
path <- fs::path_package(package = package, "examples", ..., ext = "R")
Expand All @@ -34,7 +35,7 @@ source_pef_elf <- purrr::partial(source_pef, package = "elf")
#' @inheritParams fs::path
#' @inheritParams usethis::use_template
#' @export
#' @keywords example helpers
#' @family example helpers
use_ex_file <- function(..., open = rlang::is_interactive()) {
# TODO https://github.com/dataheld/elf/issues/2
# take currently open file name from usethis
Expand Down
4 changes: 2 additions & 2 deletions R/installed.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#' Check if a package is installed
#'
#' Wrapper around [rlang::is_installed()].
#' @keywords dependencies helper
#' @family dependencies helper
#' @name pkg_installed
NULL

Expand Down Expand Up @@ -64,7 +64,7 @@ skip_if_pkg_not_installed2 <- make_skip_if_not_function(check_pkg_installed)
#' used the `load_all()`d version of an in-development package,
#' but may instead use whichever version was last installed.
#' This can lead to inconsistent results and painful confusion.
#' @keywords dependencies helper
#' @family dependencies helper
#' @name pkg_installed_but_not_via_loadall
NULL

Expand Down
2 changes: 1 addition & 1 deletion R/options.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#' @param x An option name.
#' @inheritParams options::opt_set
#' @inheritParams withr::defer
#' @keywords options helper
#' @family options helpers
#' @export
opt_set_local2 <- function(x,
value,
Expand Down
4 changes: 2 additions & 2 deletions R/tests.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#'
#' To be used as an argument for [testthat::expect_snapshot()].
#' @param x A character vector.
#' @keywords snapshot helpers, testing helpers
#' @family testing helpers
#' @name transform_snap
NULL

Expand Down Expand Up @@ -45,7 +45,7 @@ transform_with_generated <- function(x = character()) {
#' }
#' ```
#' @export
#' @keywords testing helpers
#' @family testing helpers
make_skip_if_not_function <- function(check.fun) {
force(check.fun)
function(...) {
Expand Down
14 changes: 14 additions & 0 deletions pkgdown/_pkgdown.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
---
url: https://elf.maxheld.de
authors:
Maximilian Held:
href: http://www.maxheld.de
template:
bootstrap: 5
bootswatch: cosmo
reference:
- title: Dependencies
- contents:
- has_concept("dependencies helper")
- title: Examples
- contents:
- has_concept("example helpers")
- title: Options
- contents:
- has_concept("options helpers")
- title: Tests
- contents:
- has_concept("testing helpers")

0 comments on commit b71bd97

Please sign in to comment.