Use actions/deploy-pages #17
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
name: Build | |
on: [push, pull_request] | |
jobs: | |
build: | |
strategy: | |
matrix: | |
emscripten_version: ['3.1.52', latest] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.3.0' | |
- name: Setup emsdk | |
run: | | |
git clone https://github.com/emscripten-core/emsdk | |
cd emsdk | |
./emsdk install ${{ matrix.emscripten_version }} | |
./emsdk activate ${{ matrix.emscripten_version }} | |
./emsdk construct_env | |
- name: Build irb | |
run: | | |
source emsdk/emsdk_env.sh | |
npm install | |
cd ruby.wasm | |
./bin/setup | |
bundle exec rake compile | |
RUBY_WASM_ADDITIONAL_EXTS=io/console,io/wait RUBY_WASM_EMCC_LDFLAGS="-sASYNCIFY --js-library ${{ github.workspace }}/node_modules/xterm-pty/emscripten-pty.js" bundle exec rake npm:ruby-head-wasm-emscripten:build || find . -name config.log | |
cd .. | |
npm run build | |
- if: matrix.platforms.emscripten_version != 'latest' | |
name: Upload Pages artifact | |
uses: actions/upload-pages-artifact@v2 | |
with: | |
path: docs | |
deploy: | |
if: github.event_name == 'push' | |
needs: build | |
permissions: | |
pages: write | |
id-token: write | |
actions: read | |
environment: | |
name: github-pages | |
url: https://mame.github.io/emirb/ | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to GitHub Pages | |
uses: actions/deploy-pages@v4 |