Skip to content

Merge pull request #1874 from qdraw/snyk-upgrade-584f7c0c98add8cea795… #128

Merge pull request #1874 from qdraw/snyk-upgrade-584f7c0c98add8cea795…

Merge pull request #1874 from qdraw/snyk-upgrade-584f7c0c98add8cea795… #128

on:
pull_request:
branches: [ master ]
paths:
- 'starsky/starsky/clientapp/.storybook/**'
- 'starsky/starsky/clientapp/package.json'
- 'starsky/starsky/clientapp/package-lock.json'
- '.github/workflows/clientapp-storybook-netlify.yml'
push:
branches: [ master ]
paths:
- 'starsky/starsky/clientapp/**'
- '.github/workflows/clientapp-storybook-netlify.yml'
workflow_dispatch:
name: storybook clientapp netlify
jobs:
test:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Cache node modules clientapp
uses: actions/cache@v4
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-clientapp-${{ hashFiles('./starsky/starsky/clientapp/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-clientapp-
- name: Install Dependencies
working-directory: ./starsky/starsky/clientapp
run: npm ci --no-progress --prefer-offline --legacy-peer-deps --no-fund
- name: build-storybook
working-directory: ./starsky/starsky/clientapp
run: npm run build-storybook
- name: Upload a Build Artifact
uses: actions/upload-artifact@v4
with:
name: storybook-static
path: ./starsky/starsky/clientapp/storybook-static
- name: Install Netlify
if: github.event_name != 'pull_request'
run: npm install [email protected] -g
- name: Deploy to Netlify
if: github.event_name != 'pull_request'
id: netlify_deploy
working-directory: ./starsky/starsky/clientapp
run: |
netlify deploy \
--dir storybook-static \
--site ${{ secrets.NETLIFY_STORYBOOK_SITE_ID }} \
--auth ${{ secrets.NETLIFY_AUTH_TOKEN }}