Skip to content

Commit

Permalink
ci: use r-wasm recommended repo build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
adamblake committed Nov 10, 2023
1 parent 5de8c09 commit cd69610
Showing 1 changed file with 13 additions and 28 deletions.
41 changes: 13 additions & 28 deletions .github/workflows/deploy-wasm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,53 +5,38 @@ on:
branches: [main]
workflow_dispatch:

# set permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
packages: read

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Build job
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/actions/configure-pages
- name: Setup Pages
id: pages
uses: actions/configure-pages@v3

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

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

# Deployment job
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 }}
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
- name: Download wasm artifacts
uses: r-wasm/actions/download-wasm-artifacts@v1
with:
repo-path: _site
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v2
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2

0 comments on commit cd69610

Please sign in to comment.