fix ci errors #18
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: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
ci: | |
name: ci | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out Git repository ⏬ | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: pnpm/action-setup@v4 | |
name: Install pnpm | |
with: | |
run_install: false | |
- name: Set up Node.js 💿 | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: ".node-version" | |
cache: pnpm | |
- name: Install dependencies 💤 | |
run: pnpm install | |
- name: Derive appropriate SHAs for base and head for `nx affected` commands | |
uses: nrwl/nx-set-shas@v4 | |
id: nx-sha | |
with: | |
main-branch-name: master | |
- name: "Get affected projects" | |
uses: actions/github-script@v7 | |
id: affected-projects | |
with: | |
script: | | |
const { spawnSync } = require("node:child_process") | |
const command = spawnSync("npx nx show projects --affected", { shell: true }) | |
return command.stdout.toString().replaceAll("\n", " ") | |
- name: Check formatting 🎨 | |
run: npx nx format:check | |
- name: Lint and build projects 👷♀️ | |
run: npx nx affected -t lint build publint | |
- name: Deploy docs 🚀 | |
if: github.ref == 'refs/heads/master' && contains(steps.affected-projects.outputs.result, 'docs') | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./packages/docs/dist |