Skip to content

Commit

Permalink
Better github pages actrion?
Browse files Browse the repository at this point in the history
  • Loading branch information
dereckmezquita committed Jul 6, 2024
1 parent 689014e commit 03dbd79
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 28 deletions.
60 changes: 32 additions & 28 deletions .github/workflows/pkgdown.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,45 @@
# https://github.com/Appsilon/shiny.blueprint
#https://github.com/tidyverse/ggplot2/blob/main/.github/workflows/pkgdown.yaml
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
release:
types: [published]
workflow_dispatch:

name: pkgdown
# on:
# push:
# branches: [main]
# workflow_dispatch:
on: push
permissions:
contents: write

jobs:
main:
name: Build and publish website
pkgdown:
runs-on: ubuntu-latest
timeout-minutes: 30
# Only restrict concurrency for non-PR jobs
concurrency:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- uses: actions/checkout@v3

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

- name: Install R
uses: r-lib/actions/setup-r@v2
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- name: Install R package dependencies
uses: r-lib/actions/setup-r-dependencies@v2
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::pkgdown, local::.
needs: website

- name: Configure git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Deploy to branch
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}
run: pkgdown::deploy_to_branch(branch = "bot/github-pages")

- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@v4.4.1
with:
clean: false
branch: gh-pages
folder: docs
1 change: 1 addition & 0 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ output: github_document
knitr::opts_chunk$set(
warning = FALSE,
message = FALSE,
fig.path = "man/figures/README-",
fig.align = "center",
fig.width = 12,
fig.height = 10,
Expand Down

0 comments on commit 03dbd79

Please sign in to comment.