synthetic-data-showcase/.github/workflows/javascript-ci.yml

71 строка
2.0 KiB
YAML

name: Javascript CI
on:
push:
branches: ['main']
pull_request:
branches: ['dev', 'main']
permissions:
contents: write
env:
CARGO_TERM_COLOR: always
jobs:
webapp_build:
name: Check web app build
strategy:
matrix:
platform: [ubuntu-latest]
node-version: [16.x]
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install wasm-pack
run: cargo install wasm-pack
- name: Run lib-wasm build
working-directory: ./packages/lib-wasm
run: wasm-pack build --release --target web --out-dir ${{ github.workspace }}/target/wasm
- name: Set up Node ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Rename wasm package
run: |
npm install replace -g
replace "sds-wasm" "@essex/sds-core" ./target/wasm/package.json
- name: Install dependencies
run: yarn install
- name: CI
env:
VITE_BASE_URL: /synthetic-data-showcase/
VITE_SDS_WASM_LOG_LEVEL: warn
NODE_OPTIONS: --max_old_space_size=4096
run: yarn git:ci
- name: Check for uncommitted changes
run: git diff-index --quiet HEAD --
- name: Publish wasm core
if: ${{ github.repository == 'microsoft/synthetic-data-showcase' && github.event_name == 'push' && github.ref == 'refs/heads/main' }}
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn release
- name: Deploy site
if: ${{ github.repository == 'microsoft/synthetic-data-showcase' && github.event_name == 'push' && github.ref == 'refs/heads/main' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
npx -y gh-pages -d ${{ github.workspace }}/packages/webapp/dist -u "github-actions-bot <support+actions@github.com>"