From ef5cce4dc4ffe865d9b1624188321d74f9d3fb58 Mon Sep 17 00:00:00 2001 From: Stephanie Zeng Date: Fri, 26 Apr 2024 14:52:55 -0400 Subject: [PATCH] feat: add workflow to deploy storybook to github page --- .github/workflows/deploy-storybook.yml | 52 ++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/deploy-storybook.yml diff --git a/.github/workflows/deploy-storybook.yml b/.github/workflows/deploy-storybook.yml new file mode 100644 index 0000000..02d4bd5 --- /dev/null +++ b/.github/workflows/deploy-storybook.yml @@ -0,0 +1,52 @@ +name: Deploy Storybook to Github Page for PR + +on: + pull_request: + branches: ['main'] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: false + +main: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [18.x] + steps: + - name: Checkout the codebase + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + + - name: Install Dependencies + run: npm ci + + - name: Build Storybook + run: npm run build-storybook + + - name: Setup Pages + uses: actions/configure-pages@v5 + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ./storybook-static + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 \ No newline at end of file