Skip to content

Commit

Permalink
update pkgdown
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Jonsen committed Dec 9, 2022
1 parent ec1b529 commit 7ea484a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 30 deletions.
47 changes: 19 additions & 28 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# 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]
tags: ['*']
pull_request:
branches: [main, master]
release:
types: [published]
workflow_dispatch:

name: pkgdown

jobs:
pkgdown:
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork == false
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 }}
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
isPush: ${{ github.event_name == 'push' }}

steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-tinytex@v2
- uses: actions/checkout@v3

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

Expand All @@ -33,23 +33,14 @@ jobs:
extra-packages: any::pkgdown, local::.
needs: website

- name: Install package
run: R CMD INSTALL .

- name: Build and deploy pkgdown site
if: contains(env.isPush, 'true')
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "[email protected]"
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'
- name: Create website
if: contains(env.isPush, 'false')
run: |
pkgdown::build_site()
- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}

- name: Create index file
if: contains(env.isPush, 'false')
run: |
echo '<!DOCTYPE html><html><head><meta http-equiv="refresh" content="0;URL=/dev/index.html" /> <script language="javascript"> window.location.replace('/dev/index.html')</script></head></html>' > ./docs/index.html
- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/[email protected]
with:
clean: false
branch: gh-pages
folder: docs
3 changes: 1 addition & 2 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
title: aniMotum
url: https://ianjonsen.github.io/aniMotum
url: https://ianjonsen.github.io/aniMotum/
template:
params:
bootswatch: cerulean
Expand Down

0 comments on commit 7ea484a

Please sign in to comment.