Skip to content

Merge pull request #858 from emerson-eps/dependabot/npm_and_yarn/reac… #1785

Merge pull request #858 from emerson-eps/dependabot/npm_and_yarn/reac…

Merge pull request #858 from emerson-eps/dependabot/npm_and_yarn/reac… #1785

Workflow file for this run

name: GitHub Pages
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
name: Build GitHub pages
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
- name: Install dependencies
run: npm --prefix=react-app ci
- name: 📚 Build Storybook
env:
BASE_PATH: /color-tables/storybook-static/
run: npm run build-storybook --prefix ./react-app
- name: 📚 Publish Storybook
if: github.event_name == 'push'
run: |
cp -r ./react-app/storybook-static ..
git config --local user.email "color-tables-github-action"
git config --local user.name "color-tables-github-action"
git fetch origin gh-pages
git checkout --track origin/gh-pages
git clean -f -f -d -x
git rm -r --ignore-unmatch *
mv ../storybook-static .
touch .nojekyll
git add .
if git diff-index --quiet HEAD; then
echo "No changes in documentation. Skip documentation deploy."
else
git commit -m "Update Github Pages"
git push "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git" gh-pages
fi