From fa88133362a84b7802cd45ae52ae065867cafc4e Mon Sep 17 00:00:00 2001 From: "James P. Howard, II" Date: Sun, 5 Jul 2020 12:04:38 -0400 Subject: [PATCH] Adding pkgdown Github Action --- .Rbuildignore | 1 + .github/.gitignore | 1 + .github/workflows/pkgdown.yaml | 45 ++++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 .github/.gitignore create mode 100644 .github/workflows/pkgdown.yaml diff --git a/.Rbuildignore b/.Rbuildignore index 73e9dcd..03ed301 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -8,3 +8,4 @@ COPYRIGHT.md ^_pkgdown\.yml$ ^docs$ ^pkgdown$ +^\.github$ diff --git a/.github/.gitignore b/.github/.gitignore new file mode 100644 index 0000000..2d19fc7 --- /dev/null +++ b/.github/.gitignore @@ -0,0 +1 @@ +*.html diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml new file mode 100644 index 0000000..14092b5 --- /dev/null +++ b/.github/workflows/pkgdown.yaml @@ -0,0 +1,45 @@ +on: + push: + branches: develop + +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@master + + - 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 + 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: | + install.packages("remotes") + remotes::install_deps(dependencies = TRUE) + remotes::install_dev("pkgdown") + shell: Rscript {0} + + - name: Install package + run: R CMD INSTALL . + + - name: Deploy package + run: pkgdown::deploy_to_branch(new_process = FALSE) + shell: Rscript {0}