Merge pull request #1163 from artichoke/dependabot/npm_and_yarn/npm-d… #122
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/[email protected] | |
- name: Set toolchain versions | |
run: | | |
echo "emscripten=$(cat emscripten-toolchain)" >> $GITHUB_OUTPUT | |
id: toolchain_versions | |
- name: Install Node.js toolchain | |
uses: actions/[email protected] | |
with: | |
node-version: "lts/*" | |
# 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/[email protected] | |
with: | |
toolchain: "1.72.1" | |
target: "wasm32-unknown-emscripten" | |
- name: Install Ruby toolchain | |
uses: ruby/setup-ruby@a6e6f86333f0a2523ece813039b8b4be04560854 # v1.190.0 | |
with: | |
ruby-version: ".ruby-version" | |
bundler-cache: true | |
- name: Install Emscripten toolchain | |
uses: mymindstorm/setup-emsdk@6ab9eb1bda2574c4ddb79809fc9247783eaf9021 # v14 | |
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: npm run build | |
# Publish step | |
- name: Deploy Playground | |
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # 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: [email protected] |