Skip to content

Cns website improvements #7313

Cns website improvements

Cns website improvements #7313

Workflow file for this run

name: CI
on:
push:
branches:
- main
- develop
pull_request:
permissions:
actions: read
contents: read
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
BUILD_COMMAND: ${{ contains('main,develop', github.ref_name) && 'run-many' || 'affected' }}
BUILD_CONFIGURATION: ${{ github.ref_name == 'main' && 'production' || github.ref_name == 'develop' && 'staging' || 'preview' }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
jobs:
main:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
filter: tree:0
- name: Enable task distribution via Nx Cloud
run: |
npx nx start-ci-run --distribute-on="3 linux-medium-plus-js" \
--stop-agents-after="build,build-webcomponent,build-storybook,lint,test,compodoc:ci"
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Set Nx SHAs
uses: nrwl/nx-set-shas@v4
with:
main-branch-name: ${{ github.base_ref || github.ref_name }}
# Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud
# - run: npx nx-cloud record -- echo Hello World
- name: Check for un-formatted files
run: npx nx format:check
- name: Build projects
run: |
npx nx $BUILD_COMMAND --target="build,build-webcomponent,build-storybook,compodoc" \
--configuration=$BUILD_CONFIGURATION --outputStyle=static
- name: Lint and test projects
run: |
npx nx $BUILD_COMMAND --targets="lint,test,compodoc" \
--configuration=ci --outputStyle=static
- name: Move application files from 'browser' subdirectories
if: ${{ !cancelled() }}
run: |
find dist/apps -mindepth 2 -maxdepth 2 -type d -name "browser" \
-exec bash -c 'mv "$0"/* "$(dirname "$0")"/ && rm -rf "$0"' {} \; \
2>/dev/null || true
- name: Upload build artifacts
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: nx-build-artifacts
path: ./dist
if-no-files-found: ignore
retention-days: 1
# Nx Cloud recommends fixes for failures to help you get CI green faster. Learn more: https://nx.dev/ci/features/self-healing-ci
# - run: npx nx fix-ci
# if: always()