rwasm 0.2.0 #90
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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, pkg] | |
pull_request: | |
release: | |
types: [published] | |
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 |