refac to workspace monorepo; fix mui useTheme imports; #13
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: UI-Controls CI | |
env: | |
DOCKER_BUILDKIT: 1 | |
on: | |
push: | |
branches: [ main, develop ] | |
pull_request: | |
branches: [ main, develop ] | |
create: | |
tags: | |
- '[0-9]+.[0-9]+.[0-9]+*' | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
build_publish: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [ 18.x ] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set Branch | |
id: short_ref | |
run: echo "short_ref=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT | |
- name: Set git_url_commit | |
id: git_url_commit | |
run: echo "git_url_commit=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/commit/${GITHUB_SHA}" >> $GITHUB_OUTPUT | |
- name: Set git_url_ci_run | |
id: git_url_ci_run | |
run: echo "git_url_ci_run=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" >> $GITHUB_OUTPUT | |
- name: Set git_commit | |
id: git_commit | |
run: echo "git_commit=${GITHUB_REPOSITORY}/${GITHUB_SHA}" >> $GITHUB_OUTPUT | |
- name: Set git_ci_run | |
id: git_ci_run | |
run: echo "git_ci_run=${GITHUB_REPOSITORY}/${GITHUB_RUN_ID}" >> $GITHUB_OUTPUT | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Cache CI node_modules | |
uses: actions/cache@v4 | |
env: | |
cache-name: cache-node-modules | |
with: | |
# npm cache files are stored in `~/.npm` on Linux/macOS | |
path: ~/.npm | |
key: ${{ runner.os }}-build-${{ env.cache-name }} | |
- name: Install Deps | |
run: | | |
npm ci | |
- name: Build | |
run: | | |
npm run build | |
- name: CP License files | |
run: | | |
cp LICENSE dist/ctrls-progress | |
- name: Publish to NPM | |
if: github.ref == 'refs/heads/main' | |
#if: startsWith(github.ref, 'refs/tags/') | |
run: | | |
echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > ~/.npmrc | |
node publish.js dist/ctrls-progress | |
rm ~/.npmrc | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |