From 4e99de3e145544957cbf43d60668bd395e1e38e0 Mon Sep 17 00:00:00 2001 From: Owen Buckley Date: Mon, 21 Nov 2022 17:47:31 -0500 Subject: [PATCH] add GitHub Action for publishing Storybook to GitHub Pages --- .github/workflows/pages.yml | 32 ++++++++++++++++++++++++++++++++ README.md | 2 ++ 2 files changed, 34 insertions(+) create mode 100644 .github/workflows/pages.yml diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 0000000..91c9355 --- /dev/null +++ b/.github/workflows/pages.yml @@ -0,0 +1,32 @@ +name: Deploy GitHub Pages + +on: + push: + branches: + - main + +jobs: + + build-and-deploy: + runs-on: ubuntu-18.04 + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 16.x + + - name: Install Dependencies + run: | + yarn install --frozen-lockfile + + - name: Build + run: | + yarn clean && yarn story:build + + - name: Deploy GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + if: ${{ github.ref == 'refs/heads/main' }} + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./storybook-static \ No newline at end of file diff --git a/README.md b/README.md index e4fe2a9..765092c 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,8 @@ See _package.json_ for all options: - `yarn test:tdd` - Run tests in watch mode - `yarn story:dev` - Run Storybook for development +> _Hosted Storybook docs available through [GitHub Pages](http://analogstudiosri.github.io/www.tuesdaystunes.tv)_ + ## Release Management The project is hosted by [Netlify](https://www.netlify.com/) and is setup to deploy continuously on every merge to the mainline branch in GitHub. [GitHub Actions](https://github.com/features/actions) are used for continuous integration on PRs and Netlify will deploy preview builds for all PRs. \ No newline at end of file