Skip to content

feat(): support types show #72

feat(): support types show

feat(): support types show #72

Workflow file for this run

name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build_bricks:
name: Build bricks
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
- uses: actions/checkout@v3
with:
repository: easyops-cn/next-bricks
ref: refs/heads/master
token: ${{ secrets.GH_TOKEN_EVE }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
- name: Cache nx cache
uses: actions/cache@v3
with:
path: .cache
key: ${{ runner.os }}-nx-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-nx-
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache for yarn
uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: bricks-node-cache-${{ runner.os }}-yarn-v3-${{ hashFiles('yarn.lock') }}
restore-keys: |
bricks-node-cache-${{ runner.os }}-yarn-v3-
- name: Install dependencies (Bricks)
run: yarn install --frozen-lockfile
- name: Build:manifest (Bricks)
run: npx lerna run build:manifest
- name: Build (Bricks)
run: npx lerna run build --ignore @next-bricks/v2-adapter --ignore @next-bricks/devtools
- name: Compress artifacts
run: |
shopt -s globstar
tar --exclude='*.map' --exclude='bricks/devtools' --exclude='bricks/v2-adapter' -cvf bricks.tar bricks/*/dist bricks/*/docs bricks/*/src/**/example.yaml bricks/*/src/**/example.html netlify.toml
- uses: actions/upload-artifact@v3
with:
name: brick-artifacts
path: bricks.tar
retention-days: 1
build_docs:
name: Build docs
needs: build_bricks
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: brick-artifacts
path: ci-bricks
- name: Extract artifacts
run: tar -xvf bricks.tar
working-directory: ci-bricks
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
cache: yarn
# Fix `yarn install --frozen-lockfile` not working in monorepo.
# https://github.com/yarnpkg/yarn/issues/5840#issuecomment-468782288
- name: Get checksum before yarn install
id: yarn-lock-check-before
run: echo "::set-output name=sum::$(cksum yarn.lock)"
- run: yarn install --frozen-lockfile
- name: Get checksum after yarn install
id: yarn-lock-check-after
run: echo "::set-output name=sum::$(cksum yarn.lock)"
- name: Exit if yarn.lock updated
run: exit 1
if: steps.yarn-lock-check-before.outputs.sum != steps.yarn-lock-check-after.outputs.sum
- run: yarn build
- name: Deploy to Netlify (pull request)
id: netlify-deploy
uses: nwtgck/[email protected]
with:
publish-dir: './build'
production-branch: master
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: "${{ github.event.pull_request.title }}"
alias: docs-preview-alt-${{ github.event.number }}
netlify-config-path: ./ci-bricks/netlify.toml
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
timeout-minutes: 2
if: github.event_name == 'pull_request'
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
personal_token: ${{ secrets.GH_TOKEN_EVE }}
external_repository: easyops-cn/bricks
cname: bricks.js.org
publish_dir: ./build
publish_branch: gh-pages
force_orphan: true
if: github.event_name == 'push'