Fix versioning race #8
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: CI | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- id: cache-npm | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-node-modules | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }} | |
name: List the state of node modules | |
continue-on-error: true | |
run: npm list | |
- run: npm ci | |
- run: npm run prepublishOnly --workspace flare-core --if-present | |
- run: npm run prepublishOnly --workspace flare --if-present | |
- run: npm test --workspaces --if-present | |
- name: rebuild core docs | |
run: npm run docs --workspace=packages/flare-core | |
- name: rebuild main docs | |
run: npm run docs --workspace=packages/flare | |
- name: commit docs | |
if: ${{ github.event_name != 'pull_request' }} | |
uses: EndBug/add-and-commit@v9 | |
with: | |
author_name: GitHub Actions | |
author_email: 41898282+github-actions[bot]@users.noreply.github.com | |
message: Update docs | |
- name: build site | |
run: npm run build --workspace=apps/site | |
- name: publish | |
uses: peaceiris/actions-gh-pages@v3 | |
if: github.ref == 'refs/heads/master' | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./apps/site/out |