2022-05-12 06:29:31 +03:00
|
|
|
name: Build and Deploy Components+Style Guide
|
|
|
|
on:
|
|
|
|
push:
|
2022-09-05 22:33:01 +03:00
|
|
|
branches:
|
2023-01-28 03:18:02 +03:00
|
|
|
- develop
|
2023-01-27 01:27:34 +03:00
|
|
|
paths: ['web/stories/**', 'web/components/**', 'web/.storybook/**'] # Trigger the action only when files change in the folders defined here
|
2022-09-05 22:33:01 +03:00
|
|
|
|
2022-05-12 06:29:31 +03:00
|
|
|
jobs:
|
|
|
|
build-and-deploy:
|
|
|
|
runs-on: ubuntu-latest
|
2022-11-19 22:56:15 +03:00
|
|
|
if: github.repository == 'owncast/owncast'
|
|
|
|
|
2022-05-12 06:29:31 +03:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-10-07 23:52:25 +03:00
|
|
|
uses: actions/checkout@v4
|
2022-05-12 06:29:31 +03:00
|
|
|
|
2023-02-16 01:46:45 +03:00
|
|
|
- name: Cache node modules
|
2023-03-15 05:13:59 +03:00
|
|
|
uses: actions/cache@v3
|
2023-02-16 01:46:45 +03:00
|
|
|
env:
|
|
|
|
cache-name: cache-node-modules-bundle-web-app
|
|
|
|
with:
|
|
|
|
path: ~/.npm
|
|
|
|
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('web/package-lock.json') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-build-${{ env.cache-name }}-
|
|
|
|
${{ runner.os }}-build-
|
|
|
|
${{ runner.os }}-
|
|
|
|
|
2022-05-12 06:29:31 +03:00
|
|
|
- name: Install and Build
|
|
|
|
run: | # Install npm packages and build the Storybook files
|
|
|
|
cd web
|
2022-07-21 06:42:23 +03:00
|
|
|
npm install --include-dev --force
|
2023-01-27 01:18:07 +03:00
|
|
|
cd .storybook/tools
|
|
|
|
./generate-stories.sh
|
|
|
|
cd -
|
2022-05-12 06:29:31 +03:00
|
|
|
npm run build-storybook -- -o ../docs/components
|
|
|
|
|
2023-01-27 01:27:34 +03:00
|
|
|
- name: Commit changes
|
|
|
|
uses: EndBug/add-and-commit@v9
|
|
|
|
with:
|
|
|
|
author_name: Owncast
|
|
|
|
author_email: owncast@owncast.online
|
|
|
|
message: 'Commit updated Storybook stories'
|
2023-01-27 03:45:44 +03:00
|
|
|
add: '*.stories.*'
|
2023-01-27 01:27:34 +03:00
|
|
|
pull: '--rebase --autostash'
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
2022-05-13 01:21:46 +03:00
|
|
|
- name: Dispatch event to web site
|
|
|
|
uses: peter-evans/repository-dispatch@v2
|
2022-05-13 01:12:01 +03:00
|
|
|
with:
|
2022-05-13 01:21:46 +03:00
|
|
|
token: ${{ secrets.BUNDLE_STORYBOOK_OWNCAST_ONLINE }}
|
2022-05-13 01:12:01 +03:00
|
|
|
repository: owncast/owncast.github.io
|
|
|
|
event-type: bundle-components-library
|