Skip to content

Commit

Permalink
ci: deploy webr repository on github pages
Browse files Browse the repository at this point in the history
  • Loading branch information
adamblake committed Nov 10, 2023
1 parent bd491c2 commit cd5a9cd
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/build-wasm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
- ".vscode/**"
- "bin/**"
branches:
- main
- release/*
- hotfix/*
pull_request:
Expand All @@ -28,6 +27,9 @@ jobs:
runs-on: ubuntu-latest
container: ghcr.io/r-wasm/webr:main
steps:
# https://github.com/actions/checkout
- uses: actions/checkout@v3

# https://github.com/r-wasm/actions
- name: Build wasm packages
uses: r-wasm/actions/build-wasm-packages@v1
50 changes: 50 additions & 0 deletions .github/workflows/deploy-wasm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
on:
push:
branches: [main]
workflow_dispatch:

name: Build WASM R package repository

jobs:
build:
runs-on: ubuntu-latest
container: ghcr.io/r-wasm/webr:main
steps:
# https://github.com/actions/checkout
- uses: actions/checkout@v3

# https://github.com/r-wasm/actions
- name: Build wasm packages
uses: r-wasm/actions/build-wasm-packages@v1
with:
strip: c("demo", "doc", "examples", "help", "html", "include", "tests", "vignette")

deploy:
name: Deploy to GitHub pages
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
# https://github.com/actions/checkout
- uses: actions/checkout@v3

# https://github.com/r-wasm/actions
- name: Download wasm artifacts
uses: r-wasm/actions/download-wasm-artifacts@v1
with:
repo-path: _site
image-path: _site

# https://github.com/actions/upload-pages-artifact
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v2

# https://github.com/actions/deploy-pages
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2

0 comments on commit cd5a9cd

Please sign in to comment.