Skip to content

CI: Separate Build/Deploy workflows (#454) #1225

CI: Separate Build/Deploy workflows (#454)

CI: Separate Build/Deploy workflows (#454) #1225

Workflow file for this run

name: Build
on:
pull_request:
push:
branches:
- main
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- uses: actions/setup-node@v4
id: setup-node
with:
node-version: '18'
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- name: Install dependencies
run: |
npm ci --ignore-scripts
# Please check with Brave's security team prior to adding any packages to this list.
- run: npm rebuild style-dictionary-create-react-app
- name: Format
id: format
run: |
npm run format-diff
- name: Build nala
id: build-nala
run: |
npm run build
- name: Audit Tokens
id: audit-tokens
run: |
node ./src/scripts/audit-tokens.js
- name: Diff Tokens
id: diff-tokens
run: |
curl -fsSL -o ./tokens/css/variables.old.css https://nala.bravesoftware.com/css/variables.css
# Note: Diff has exit code 1 for differences, and there are always
# some differences because the file contains a timestamp.
diff -u ./tokens/css/variables.old.css ./tokens/css/variables.css > ./tokens/css/variables.diff || :
- name: Check Types
id: check-types
run: |
npm run check
- name: Build the React example project
id: example-react
working-directory: ./examples/example-ui-react
run: |
npm install --no-save
npm run build
- name: Build Storybook
env:
NODE_OPTIONS: '--max_old_space_size=6144'
run: npm run build-storybook
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: build
if-no-files-found: error
path: |
./storybook-static
./tokens/css/variables.diff