Skip to content

manual-publish

manual-publish #284

Workflow file for this run

name: Publish
on:
schedule:
- cron: '0 0 * * 6'
repository_dispatch:
types: manual-publish
jobs:
pre-publish-validation:
name: Prime UT
runs-on: ${{ matrix.os }}
if: github.repository == 'ot-builder/monorepo'
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest] # All operating systems
node-version: [lts/*, latest] # Current and LTS. No history versions
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Validation
run: |
npm run init
npm run build
npm run test
env:
CI: true
publish:
needs: pre-publish-validation
name: Publish
runs-on: ubuntu-latest
if: github.repository == 'ot-builder/monorepo'
steps:
- name: Fetch main repository
uses: actions/checkout@v3
with:
ref: master
fetch-depth: 0
token: ${{secrets.SECRET_GITHUB_TOKEN}}
- name: Fetch docs repository
uses: actions/checkout@v3
with:
repository: ot-builder/ot-builder.github.io.git
ref: master
path: .doc-deploy
token: ${{secrets.SECRET_GITHUB_TOKEN}}
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: lts/*
- name: NPM Setup
run: |
npm run init:prod
env:
CI: true
- name: Production Build
run: |
npm run build:prod
env:
CI: true
- name: Publish
run: |
npm run publish
env:
SECRET_NPM_TOKEN: ${{secrets.SECRET_NPM_TOKEN}}