Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions examples/README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ RMarkdown workflows:

- [`render-rmarkdown`](#render-rmarkdown) - Render one or more Rmarkdown files when they change and commit the result.
- [`bookdown`](#build-bookdown-site) - Build a [bookdown] site and deploy it to [GitHub Pages] or [Cloudflare Pages].
- [`bookdown-gh-pages`](#build-bookdown-site-alternative-workflow) - Alternative workflow to build a [bookdown] site and deploy it to [GitHub Pages].
- [`blogdown`](#build-blogdown-site) - Build a [blogdown] site and deploy it to [GitHub Pages] or [Cloudflare Pages].
- [`blogdown-gh-pages`](#build-blogdown-site-alternative-workflow) - Alternative workflow to build a [blogdown] site and deploy it to [GitHub Pages].

Other workflows:

Expand Down Expand Up @@ -225,6 +227,17 @@ Pages documentation for details.
print_yaml("bookdown.yaml")
```

## Build bookdown site, alternative workflow

`usethis::use_github_action("bookdown-gh-pages")`

This is an alternative workflow that builds and publishes a bookdown book,
without creating a separate branch in the repository for the built book.

```{r echo = FALSE, results = "asis"}
print_yaml("bookdown-gh-pages.yaml")
```

## Build blogdown site

`usethis::use_github_action("blogdown")`
Expand All @@ -245,6 +258,16 @@ Pages documentation for details.
```{r echo = FALSE, results = "asis"}
print_yaml("blogdown.yaml")
```
## Build blogdown site, alternative workflow

`usethis::use_github_action("blogdown-gh-pages")`

This is an alternative workflow that builds and publishes a blogdown site,
without creating a separate branch in the repository for the built site.

```{r echo = FALSE, results = "asis"}
print_yaml("blogdown-gh-pages.yaml")
```

## Shiny App Deployment

Expand Down
156 changes: 156 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,17 @@ RMarkdown workflows:
[bookdown](https://bookdown.org) site and deploy it to [GitHub
Pages](https://pages.github.com/) or [Cloudflare
Pages](https://pages.cloudflare.com/).
- [`bookdown-gh-pages`](#build-bookdown-site-alternative-workflow) -
Alternative workflow to build a [bookdown](https://bookdown.org) site
and deploy it to [GitHub Pages](https://pages.github.com/).
- [`blogdown`](#build-blogdown-site) - Build a
[blogdown](https://bookdown.org/yihui/blogdown/) site and deploy it to
[GitHub Pages](https://pages.github.com/) or [Cloudflare
Pages](https://pages.cloudflare.com/).
- [`blogdown-gh-pages`](#build-blogdown-site-alternative-workflow) -
Alternative workflow to build a
[blogdown](https://bookdown.org/yihui/blogdown/) site and deploy it to
[GitHub Pages](https://pages.github.com/).

Other workflows:

Expand Down Expand Up @@ -812,6 +819,82 @@ jobs:
folder: _book
```

## Build bookdown site, alternative workflow

`usethis::use_github_action("bookdown-gh-pages")`

This is an alternative workflow that builds and publishes a bookdown
book, without creating a separate branch in the repository for the built
book.

``` yaml
# 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]
pull_request:
branches: [main, master]
workflow_dispatch:

name: Deploy bookdown to GH Pages

permissions: read-all

jobs:
build:
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 }}
steps:
- uses: actions/checkout@v4

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

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

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

- name: Cache bookdown results
uses: actions/cache@v4
with:
path: _bookdown_files
key: bookdown-${{ hashFiles('**/*Rmd') }}
restore-keys: bookdown-

- name: Build site
run: bookdown::render_book("index.Rmd", quiet = TRUE)
shell: Rscript {0}

- name: Upload website artifact
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' }}
uses: actions/upload-pages-artifact@v3
with:
path: "_book"

deploy:
needs: build

permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
```

## Build blogdown site

`usethis::use_github_action("blogdown")`
Expand Down Expand Up @@ -882,6 +965,79 @@ jobs:
folder: public
```

## Build blogdown site, alternative workflow

`usethis::use_github_action("blogdown-gh-pages")`

This is an alternative workflow that builds and publishes a blogdown
site, without creating a separate branch in the repository for the built
site.

``` yaml
# 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]
pull_request:
branches: [main, master]
workflow_dispatch:

name: Deploy blogdown to GH Pages

permissions: read-all

jobs:
build:
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 }}
steps:
- uses: actions/checkout@v4

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

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

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

- name: Install hugo
run: blogdown::install_hugo()
shell: Rscript {0}

- name: Build site
run: blogdown::build_site(TRUE)
shell: Rscript {0}

- name: Upload website artifact
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' }}
uses: actions/upload-pages-artifact@v3
with:
path: "public"

deploy:
needs: build

permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
```

## Shiny App Deployment

`usethis::use_github_action("shiny-deploy")`
Expand Down
62 changes: 62 additions & 0 deletions examples/blogdown-gh-pages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# 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]
pull_request:
branches: [main, master]
workflow_dispatch:

name: Deploy blogdown to GH Pages

permissions: read-all

jobs:
build:
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 }}
steps:
- uses: actions/checkout@v4

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

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

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

- name: Install hugo
run: blogdown::install_hugo()
shell: Rscript {0}

- name: Build site
run: blogdown::build_site(TRUE)
shell: Rscript {0}

- name: Upload website artifact
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' }}
uses: actions/upload-pages-artifact@v3
with:
path: "public"

deploy:
needs: build

permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
65 changes: 65 additions & 0 deletions examples/bookdown-gh-pages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# 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]
pull_request:
branches: [main, master]
workflow_dispatch:

name: Deploy bookdown to GH Pages

permissions: read-all

jobs:
build:
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 }}
steps:
- uses: actions/checkout@v4

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

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

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

- name: Cache bookdown results
uses: actions/cache@v4
with:
path: _bookdown_files
key: bookdown-${{ hashFiles('**/*Rmd') }}
restore-keys: bookdown-

- name: Build site
run: bookdown::render_book("index.Rmd", quiet = TRUE)
shell: Rscript {0}

- name: Upload website artifact
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' }}
uses: actions/upload-pages-artifact@v3
with:
path: "_book"

deploy:
needs: build

permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4