Skip to content

ci: warmup ruby.wasm build with js-free version #21

ci: warmup ruby.wasm build with js-free version

ci: warmup ruby.wasm build with js-free version #21

Workflow file for this run

name: Build
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: 1.74.0
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2
bundler-cache: true
- name: Setup yarn
run: npm install -g yarn
- uses: actions/setup-node@v4
with:
node-version: 21
cache: yarn
- name: Cache ruby.wasm artefacts
id: cache-ruby-wasm
uses: actions/cache@v4
with:
path: |
build
rubies
key: ${{ runner.os }}-ruby-wasm
- name: Cache compiled ruby.wasm module
id: cache-ruby-wasm-module
uses: actions/cache@v4
with:
path: |
src/ruby.wasm
key: ${{ runner.os }}-${{ hashFiles('**/Gemfile.lock') }}-ruby-wasm-module
- name: Build ruby.wasm
if: steps.cache-ruby-wasm-module.outputs.cache-hit != 'true'
run: |
bundle config set frozen false
JS=false bundle exec rbwasm build -o ruby.tmp.wasm --ruby-version 3.2
bundle exec rbwasm build -o src/ruby.wasm --ruby-version 3.2
- name: Build web app
run: |
yarn install
yarn build
- name: Push to Github Pages
if: github.ref == 'refs/heads/master' || github.event_name == 'workflow_dispatch'
uses: actions/upload-pages-artifact@v1
with:
path: './dist'
deploy:
needs: build
if: github.ref == 'refs/heads/master' || github.event_name == 'workflow_dispatch'
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v1