You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.7 KiB
54 lines
1.7 KiB
name: Build and Deploy Components+Style Guide |
|
on: |
|
push: |
|
branches: |
|
- develop |
|
paths: ['web/stories/**', 'web/components/**', 'web/.storybook/**'] # Trigger the action only when files change in the folders defined here |
|
|
|
jobs: |
|
build-and-deploy: |
|
runs-on: ubuntu-latest |
|
if: github.repository == 'owncast/owncast' |
|
|
|
steps: |
|
- name: Checkout |
|
uses: actions/checkout@v3 |
|
|
|
- name: Cache node modules |
|
uses: actions/cache@v2 |
|
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 }}- |
|
|
|
- name: Install and Build |
|
run: | # Install npm packages and build the Storybook files |
|
cd web |
|
npm install --include-dev --force |
|
cd .storybook/tools |
|
./generate-stories.sh |
|
cd - |
|
npm run build-storybook -- -o ../docs/components |
|
|
|
- name: Commit changes |
|
uses: EndBug/add-and-commit@v9 |
|
with: |
|
author_name: Owncast |
|
author_email: owncast@owncast.online |
|
message: 'Commit updated Storybook stories' |
|
add: '*.stories.*' |
|
pull: '--rebase --autostash' |
|
env: |
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
|
|
|
- name: Dispatch event to web site |
|
uses: peter-evans/repository-dispatch@v2 |
|
with: |
|
token: ${{ secrets.BUNDLE_STORYBOOK_OWNCAST_ONLINE }} |
|
repository: owncast/owncast.github.io |
|
event-type: bundle-components-library
|
|
|