Skip to content

Publish data-grid-react #4

Publish data-grid-react

Publish data-grid-react #4

# TODO: Create a composite action for publishing to simplify things
name: Publish data-grid-react
on:
workflow_dispatch:
inputs:
npm-tag:
description: 'Tag for npm package (next | latest)'
required: true
type: choice
options:
- next
- latest
default: 'next'
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
jobs:
setup:
uses: equinor/design-system/.github/workflows/_setup.yml@develop
secrets: inherit
with:
cacheKey: ${{ github.sha }}
checkout_paths: packages/eds-core-react packages/eds-tokens packages/eds-icons packages/eds-utils packages/eds-data-grid-react
tag: ${{ github.event.inputs.npm-tag }}
packages:
name: Process packages
runs-on: ubuntu-latest
needs: [setup]
steps:
- name: Use "setup" cache
id: setup-cache
uses: actions/cache@v3
with:
path: |
./*
~/.pnpm-store
key: ${{ github.sha }}
- name: Use "dist" cache
id: dist-cache
uses: actions/cache@v3
with:
path: |
./*
~/.pnpm-store
key: ${{ github.sha }}-dist-${{ github.event.inputs.environment }}-data-grid
- name: Build packages
id: build-packages
run: node_modules/.bin/pnpm run build
- name: Build data-grid Storybook
id: build-storybook
run: node_modules/.bin/pnpm build:storybook:data-grid
- name: log-errors-to-slack
uses: act10ns/slack@v2
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
if: failure()
publish-data-grid-package:
name: Publish data grid to npm
runs-on: ubuntu-latest
needs: [setup, packages]
steps:
- name: Use "dist" cache
id: dist-cache
uses: actions/cache@v3
with:
path: |
./*
~/.pnpm-store
key: ${{ github.sha }}-dist-${{ github.event.inputs.environment }}-data-grid
- name: Publish to npm
id: publish-to-npm
run: |
node_modules/.bin/pnpm config set '//registry.npmjs.org/:_authToken' ${{ secrets.NPM_TOKEN }}
node_modules/.bin/pnpm --filter @equinor/eds-data-grid-react publish --access public --tag ${{ needs.setup.outputs.tag }} --no-git-checks
- name: log-errors-to-slack
uses: act10ns/slack@v2
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
if: failure()
publish-storybook:
needs: [setup, packages]
name: Publish Storybook
runs-on: ubuntu-latest
steps:
- name: Use cache with storybook files
id: use-cache-storybook
uses: actions/cache@v3
with:
path: |
./*
~/.pnpm-store
key: ${{ github.sha }}-dist-${{ github.event.inputs.environment }}-data-grid
- name: Deploy the website
id: deploy-website
uses: tibor19/static-website-deploy@v2
with:
enabled-static-website: 'true'
folder: 'packages/eds-data-grid-react/storybook-build'
public-access-policy: 'container'
connection-string: ${{ secrets.AZ_STORAGE_STORYBOOK_DATAGRID_CONNECTION_STRING }}
- name: log-errors-to-slack
uses: act10ns/slack@v2
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
if: failure()