Merge pull request #1094 from artichoke/dependabot/cargo/cargo-deps-7… #68
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: Publish | |
"on": | |
push: | |
branches: | |
- trunk | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
jobs: | |
# Build job | |
build: | |
name: Build Playground | |
runs-on: ubuntu-latest | |
env: | |
RUSTFLAGS: -D warnings | |
RUST_BACKTRACE: 1 | |
CARGO_NET_GIT_FETCH_WITH_CLI: true | |
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3.5.3 | |
- name: Set toolchain versions | |
run: | | |
echo "emscripten=$(cat emscripten-toolchain)" >> $GITHUB_OUTPUT | |
id: toolchain_versions | |
- name: Install Node.js toolchain | |
uses: actions/setup-node@v3.7.0 | |
with: | |
node-version: 18 | |
# Must install deps before setting up emscripten toolchain since emsdk | |
# includes its own older node which does not support lockfileversion 3 | |
# in package-lock.json. | |
- name: Install Node.js dependencies | |
run: npm ci | |
- name: Install Rust toolchain | |
uses: artichoke/setup-rust/build-and-test@v1.10.0 | |
with: | |
toolchain: "1.69.0" | |
target: "wasm32-unknown-emscripten" | |
- name: Install Ruby toolchain | |
uses: ruby/setup-ruby@250fcd6a742febb1123a77a841497ccaa8b9e939 # v1.152.0 | |
with: | |
ruby-version: ".ruby-version" | |
bundler-cache: true | |
- name: Install Emscripten toolchain | |
uses: mymindstorm/setup-emsdk@ab889da2abbcbb280f91ec4c215d3bb4f3a8f775 # v12 | |
with: | |
version: ${{ steps.toolchain_versions.outputs.emscripten }} | |
no-cache: true | |
- name: Verify emcc version | |
run: emcc -v | |
- name: Compile Wasm | |
run: ruby scripts/build-wasm.rb --release --verbose | |
- name: Build Webapp | |
run: node build.mjs --release | |
# Publish step | |
- name: Deploy Playground | |
uses: peaceiris/actions-gh-pages@373f7f263a76c20808c831209c920827a82a2847 # v3.9.2 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./dist | |
publish_branch: gh-pages | |
cname: artichoke.run | |
user_name: artichoke-ci | |
user_email: ci@artichokeruby.org |