Skip to content

Bump @lerna-lite/cli from 4.3.0 to 4.4.1 #4483

Bump @lerna-lite/cli from 4.3.0 to 4.4.1

Bump @lerna-lite/cli from 4.3.0 to 4.4.1 #4483

Workflow file for this run

name: Build and Deploy GitHub Pages
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
concurrency:
# https://stackoverflow.com/a/72408109
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
env:
GITHUB_PAGES_SUBDIR_BROWSER: lib/browser
jobs:
build:
strategy:
matrix:
target: ["browser"]
env:
# To avoid an error like "FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory".
# See https://github.com/actions/virtual-environments/issues/70#issuecomment-653886422
# The Linux VM has 7GB RAM (https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources),
# so we set the max memory size as 6.5 GiB like https://nodejs.org/api/cli.html#--max-old-space-sizesize-in-megabytes
NODE_OPTIONS: "--max-old-space-size=6656"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
persist-credentials: false
- uses: ./.github/actions/init-all
with:
python-version-file: ".python-version"
node-version-file: ".nvmrc"
- name: Set up
run: make init
## Build and deploy @stlite/browser
# PUBLIC_URL here is set as a relative path, which is possible to the trick introduced at https://github.com/whitphx/stlite/pull/143.
- if: matrix.target == 'browser'
name: Set PUBLIC_URL
run: echo "PUBLIC_URL=." >> $GITHUB_ENV
- if: matrix.target == 'browser'
name: Build @stlite/browser
run: |
. .venv/bin/activate
make browser
- if: matrix.target == 'browser'
name: Upload the built files as an artifact
uses: actions/upload-artifact@v4
with:
name: stlite-browser
path: packages/browser/build
deploy:
needs: build
runs-on: ubuntu-latest
# Settings for GitHub pages deployment, ref: https://github.com/peaceiris/actions-gh-pages#getting-started
permissions:
contents: write
steps:
- uses: actions/download-artifact@v4
with:
name: stlite-browser
path: browser
- name: Configure redirect
run: |
mkdir -p /tmp/website/
cat << _EOT_ > /tmp/website/_config.yml
plugins:
- jekyll-redirect-from
_EOT_
cat << _EOT_ > /tmp/website/index.html
---
redirect_to: "https://edit.share.stlite.net/"
---
_EOT_
cp /tmp/website/index.html /tmp/website/404.html
- name: Set the build artifact paths
run: |
mkdir -p /tmp/website/${GITHUB_PAGES_SUBDIR_BROWSER}
cp -r ./browser/* /tmp/website/${GITHUB_PAGES_SUBDIR_BROWSER}/.
- name: Upload the website files as an artifact
uses: actions/upload-artifact@v4
if: ${{ github.ref != 'refs/heads/main' }}
with:
name: website
path: /tmp/website
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
if: ${{ github.ref == 'refs/heads/main' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: /tmp/website
enable_jekyll: true