Skip to content

Merge pull request #68 from mj-studio-library/develop #53

Merge pull request #68 from mj-studio-library/develop

Merge pull request #68 from mj-studio-library/develop #53

Workflow file for this run

name: Publish
on:
push:
branches:
- main
- alpha
jobs:
publish-packages:
name: Publish packages to NPM
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: main
fetch-depth: '0'
token: ${{ secrets.GH_TOKEN }}
- name: Set node version
uses: actions/setup-node@v4
with:
node-version: 20
- name: Set git config
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor }}@users.noreply.github.com"
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
- name: Cache dependencies
id: cache
uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
${{ runner.os }}-node-
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: yarn install --immutable
- name: Cache Example dependencies
id: cache-example
uses: actions/cache@v3
with:
path: 'example/node_modules'
key: ${{ runner.os }}-node-${{ hashFiles('example/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-${{ hashFiles('example/yarn.lock') }}
${{ runner.os }}-node-
- name: Install Example dependencies
if: steps.cache-example.outputs.cache-hit != 'true'
working-directory: example
run: yarn install --immutable
- name: Cache Doc dependencies
id: cache-doc
uses: actions/cache@v3
with:
path: 'doc/node_modules'
key: ${{ runner.os }}-node-${{ hashFiles('doc/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-${{ hashFiles('doc/yarn.lock') }}
${{ runner.os }}-node-
- name: Install Doc dependencies
if: steps.cache-doc.outputs.cache-hit != 'true'
working-directory: doc
run: yarn install --immutable
- name: Build Docs
working-directory: doc
run: yarn build
- name: Deploy Docs
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GH_TOKEN }}
publish_dir: ./doc/build
user_name: github-actions[bot]
user_email: 41898282+github-actions[bot]@users.noreply.github.com
- name: Check
run: yarn check:all
- name: Build
run: yarn lerna run build
- name: Set npm config
run: npm config set registry http://registry.npmjs.org
- name: Publish
run: yarn lerna publish --yes