manual-publish #284
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: 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}} |