Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add examples/rwasm-binary-and-pkgdown-site.yml #17

Merged
merged 4 commits into from
Apr 2, 2024
Merged
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
68 changes: 68 additions & 0 deletions examples/rwasm-binary-and-pkgdown-site.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Workflow derived from https://github.com/r-wasm/actions/tree/v1/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:

name: R Wasm & pkgdown deploy

jobs:
build-site:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- name: Checkout repository
uses: actions/checkout@v4

# Usual steps for generating a pkgdown website
- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::pkgdown, local::.
needs: website
# Change the build directory to `_site`
- name: Build site
shell: Rscript {0}
run: |
pkgdown::build_site_github_pages(
new_process = FALSE,
install = FALSE,
dest_dir = "_site"
)

# Build the local R package and structure the CRAN repository
- name: Build Wasm R packages
uses: r-wasm/actions/build-rwasm@v1
with:
packages: "."
repo-path: "_site"

# Upload an artifact that will work with GitHub Pages
- name: Upload Pages artifact
if: github.event_name != 'pull_request'
uses: actions/upload-pages-artifact@v3
with:
path: "_site"

deploy:
if: github.event_name != 'pull_request'
needs: [build-site]
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
Loading