Skip to content

upgrd unified, md; rewire deps; render types; opt. CodeMirror; sandbox; #36

upgrd unified, md; rewire deps; render types; opt. CodeMirror; sandbox;

upgrd unified, md; rewire deps; render types; opt. CodeMirror; sandbox; #36

Workflow file for this run

name: Content-UI CI
env:
DOCKER_BUILDKIT: 1
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
# 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@v3
- name: Set Branch
id: short_ref
run: echo ::set-output name=short_ref::${GITHUB_REF#refs/*/}
- name: Set git_url_commit
id: git_url_commit
run: echo ::set-output name=git_url_commit::${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/commit/${GITHUB_SHA}
- name: Set git_url_ci_run
id: git_url_ci_run
run: echo ::set-output name=git_url_ci_run::${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}
- name: Set git_commit
id: git_commit
run: echo ::set-output name=git_commit::${GITHUB_REPOSITORY}/${GITHUB_SHA}
- name: Set git_ci_run
id: git_ci_run
run: echo ::set-output name=git_ci_run::${GITHUB_REPOSITORY}/${GITHUB_RUN_ID}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Cache CI node_modules
uses: actions/cache@v3
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
cd server/feed
npm ci
- name: Build
env:
REACT_APP_ENV: prod
REACT_APP_VERSION: ${{ steps.git_commit.outputs.git_commit }}
REACT_APP_API_HOST: http://localhost:4222
REACT_APP_BASE_PATH: ""
run: |
npm run build
- name: CP License files
run: |
cp LICENSE dist/struct
cp LICENSE dist/md
cp LICENSE dist/react
cp LICENSE dist/md-mui
cp LICENSE dist/input
- 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/struct
node publish.js dist/md
node publish.js dist/react
node publish.js dist/md-mui
node publish.js dist/input
rm ~/.npmrc
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Upload Artifact APP
uses: actions/upload-artifact@v3
with:
name: app-artifact
path: apps/demo/build
retention-days: 1