chore: test whoami (WIP) #9
Workflow file for this run
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@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: .nvmrc | |
cache: npm | |
- name: Install dependencies | |
run: npm ci --ignore-scripts | |
- name: Build | |
run: npm exec -- lerna run build --concurrency=2 | |
- name: Upload dist artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist-artifact | |
path: packages/**/dist | |
build-demo: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: .nvmrc | |
cache: npm | |
- name: Install dependencies | |
run: npm ci --ignore-scripts | |
- name: Build Demo | |
run: npm run build:demo | |
- name: Upload demo artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: demo-artifact | |
path: ./demo | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: .nvmrc | |
cache: npm | |
- name: Install dependencies | |
run: npm ci --ignore-scripts | |
- name: Lint | |
run: npm run lint:ci | |
test: | |
needs: [build] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: .nvmrc | |
cache: npm | |
- name: Install dependencies | |
run: npm ci --ignore-scripts | |
- name: Download dist artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: dist-artifact | |
path: packages | |
- name: Test | |
run: npm run test:ci | |
- name: Coveralls | |
run: npm exec -- coveralls < .cache/coverage/lcov.info | |
env: | |
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} | |
deploy: | |
needs: [build-demo, lint, test] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: .nvmrc | |
cache: npm | |
- name: Install dependencies | |
run: npm ci --ignore-scripts | |
# TODO: remove | |
- name: Who am i? | |
run: npm whoami | |
- name: Download demo artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: demo-artifact | |
path: ./demo | |
- name: Deploy | |
run: utils/scripts/deploy.mjs | |
env: | |
NETLIFY_TOKEN: ${{ secrets.NETLIFY_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | |
REPO_SLUG: ${{ github.repository }} | |
# TODO: remove once zdg/scripts are updated | |
CIRCLE_PROJECT_USERNAME: zendeskgarden | |
CIRCLE_PROJECT_REPONAME: react-components | |
CIRCLECI: true | |
publish: | |
needs: [build, lint, test] | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Lerna requires the full history, including tags | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: .nvmrc | |
cache: npm | |
registry-url: https://registry.npmjs.org # Sets the registry in the project level .npmrc | |
- name: Install dependencies | |
run: npm ci --ignore-scripts | |
- name: Download dist artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: dist-artifact | |
path: packages | |
# - name: Publish to npm | |
# run: npm exec -- lerna publish from-git --ignore-scripts --yes | |
# env: | |
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |