Skip to content

Commit

Permalink
added pkgdown website and gh action for it
Browse files Browse the repository at this point in the history
  • Loading branch information
16EAGLE committed Apr 18, 2024
1 parent 3fdac06 commit 6d7f552
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 8 deletions.
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@v2

- 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: Restore R package cache
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)'
25 changes: 25 additions & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
url: https://bleutner.github.io/RStoolbox/

template:
bootstrap: 5

development:
mode: release

home:
links:
- text: Find out more about our work
href: http://remote-sensing.org

navbar:
#type: inverse
left:
- text: "News"
href: news/index.html
- text: "Functions"
href: reference/index.html

right:
- icon: fa-github fa-lg fab
href: http://www.github.com/bleutner

16 changes: 8 additions & 8 deletions prep-release/makeRelease.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ else
echo "Example data already up-to-date."
fi

## Website
echo -e "\n**********************************************************"
echo "Build website documentation ******************************"
echo "**********************************************************"
git checkout gh-pages
Rscript rstbx-docu/build_docu.R
git commit -a -m "Automatic commit: Update gh-pages package documentation"
git checkout master
# ## Website ()
# echo -e "\n**********************************************************"
# echo "Build website documentation ******************************"
# echo "**********************************************************"
# git checkout gh-pages
# Rscript rstbx-docu/build_docu.R
# git commit -a -m "Automatic commit: Update gh-pages package documentation"
# git checkout master

echo -e "\n**********************************************************"
echo "R CMD check **********************************************"
Expand Down

0 comments on commit 6d7f552

Please sign in to comment.