Skip to content

Commit

Permalink
Update setup to deploy pkgdown website
Browse files Browse the repository at this point in the history
  • Loading branch information
GegznaV committed Jul 17, 2020
1 parent d28c5e4 commit 7dfd59a
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,32 @@ jobs:
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: macOS-r-4.0-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: macOS-r-4.0-1-
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")
install.packages("rmarkdown")
install.packages("ps")
remotes::install_deps(dependencies = TRUE)
remotes::install_dev("pkgdown")
install.packages("pkgdown")
shell: Rscript {0}

- name: Install package
Expand All @@ -44,10 +47,12 @@ jobs:

- name: Commit results
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Actions"
git commit README.md -m 'Re-build README.Rmd before pkgdown' || echo "No changes to commit"
git push origin || echo "No changes to commit"
- name: Deploy package
run: pkgdown::deploy_to_branch(new_process = FALSE)
shell: Rscript {0}
run: |
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'

0 comments on commit 7dfd59a

Please sign in to comment.