diff --git a/.github/workflows/release-styles.yaml b/.github/workflows/release-styles.yaml new file mode 100644 index 0000000000..b0dbf4762c --- /dev/null +++ b/.github/workflows/release-styles.yaml @@ -0,0 +1,43 @@ +### +# +# Release the demo app whenever it's package json changes on the main branch +# +### + +name: Release Styles Storybook + +on: + push: + branches: + - main + paths: + - 'packages/styles/package.json' + - 'packages/styles/src/**/*.stories.*' + - 'packages/styles/.storybook/**' + +concurrency: ${{ github.workflow }}-${{ github.ref }} + +jobs: + release: + name: Release demo + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup + uses: swisspost/design-system/.github/actions/setup-pnpm@main + + - name: Install + run: pnpm --filter "design-system-styles..." install + + - name: Build + run: pnpm --filter "design-system-styles..." build + + - name: Publish + env: + NETLIFY_SITE_ID: ${{ secrets.STYLES_NETLIFY_SITE_ID }} + NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} + run: | + netlify link --id $NETLIFY_SITE_ID + netlify deploy --build false --dir packages/styles/storybook-static --prod diff --git a/package.json b/package.json index 25f8f121fb..ab51edcd89 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "bootstrap": "pnpm install && pnpm -r build", "start": "pnpm demo:start", "demo:start": "pnpm --filter design-system-demo --filter design-system-styles --parallel --stream start", - "styles:start": "pnpm --filter design-system-styles storybook:serve", + "styles:start": "pnpm --filter design-system-styles start", "components:start": "pnpm --filter design-system-components start", "intranet-header:start": "pnpm --filter design-system-components-angular start", "docs:start": "pnpm --filter design-system-documentation start", diff --git a/packages/styles/package.json b/packages/styles/package.json index 5596378611..3c33419b7a 100644 --- a/packages/styles/package.json +++ b/packages/styles/package.json @@ -19,9 +19,9 @@ }, "scripts": { "clean": "rimraf out-tsc dist/*", - "start": "npm-run-all --parallel styles:start && schematics:start", + "start": "npm-run-all --parallel styles:start storybook:start schematics:start", "prebuild": "pnpm clean", - "build": "npm-run-all --parallel styles:build && pnpm schematics:build", + "build": "npm-run-all --parallel styles:build schematics:build storybook:build", "format": "prettier src/**/*.scss --write", "lint": "stylelint src/**/*.scss", "lint:fix": "stylelint src/**/*.scss --fix",