feat(common): onStageWithStoryBoss #4193
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_and_lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: lts/* | |
cache: yarn | |
- name: Retrieve the cached "node_modules" directory (if present) | |
uses: actions/cache@v3 | |
id: node-cache | |
with: | |
path: node_modules | |
key: node-modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }} | |
- name: Install dependencies (if the cached directory was not found) | |
if: steps.node-cache.outputs.cache-hit != 'true' | |
run: yarn install --immutable | |
- name: Build every package in the monorepo | |
run: bash build.sh | |
- name: Test every package in the monorepo | |
run: bash test.sh | |
- name: Lint every package in the monorepo | |
run: bash lint.sh | |
- name: Run ShellCheck | |
uses: ludeeus/action-shellcheck@master | |
with: | |
ignore_paths: node_modules | |
# Uncomment this for SSH debugging of CI actions. | |
#- name: Setup tmate session | |
# uses: mxschmitt/action-tmate@v3 | |
# with: | |
# limit-access-to-actor: true | |
- name: Checkout the docs repository | |
uses: actions/checkout@v3 | |
if: github.ref == 'refs/heads/main' && needs.pr-check.outputs.number != 'null' | |
with: | |
ssh-key: ${{ secrets.DOCS_SSH_PRIVATE_KEY }} | |
repository: IsaacScript/isaacscript.github.io | |
ref: gh-pages | |
# The current working directory is: | |
# /home/runner/work/isaacscript/isaacscript | |
# Thus, the following path is equivalent to: | |
# /home/runner/work/isaacscript/isaacscript/isaacscript.github.io | |
# (It is not possible to clone the repo in the parent directory for security reasons.) | |
path: isaacscript.github.io | |
- name: Deploy the documentation website | |
id: deploy_documentation_website | |
run: bash packages/docs/deploy.sh ${{ github.sha }} | |
if: github.ref == 'refs/heads/main' && needs.pr-check.outputs.number != 'null' | |
- name: Run DocSearch Scraper | |
uses: celsiusnarhwal/typesense-scraper@v2 | |
if: github.ref == 'refs/heads/main' && needs.pr-check.outputs.number != 'null' && steps.deploy_documentation_website.outputs.SHOULD_SCRAPE == '1' | |
with: | |
api-key: ${{ secrets.TYPESENSE_API_KEY }} | |
host: ${{ secrets.TYPESENSE_HOST }} | |
port: ${{ secrets.TYPESENSE_PORT }} | |
protocol: ${{ secrets.TYPESENSE_PROTOCOL }} | |
config: packages/docs/docsearch.config.json | |
discord: | |
name: Discord Failure Notification | |
needs: [build_and_lint] | |
if: always() # This is needed to always run this job, even if the other jobs fail. | |
runs-on: ubuntu-latest | |
steps: | |
- uses: technote-space/workflow-conclusion-action@v3 | |
- if: env.WORKFLOW_CONCLUSION != 'success' && env.WORKFLOW_CONCLUSION != 'cancelled' | |
uses: sarisia/actions-status-discord@v1 | |
with: | |
webhook: ${{ secrets.DISCORD_WEBHOOK }} | |
status: ${{ env.WORKFLOW_CONCLUSION }} | |
title: "" |