diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000000..5bc345b9d9 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,60 @@ +# Workflow name +name: Build and Publish Storybook to GitHub Pages + +on: + push: + +permissions: + contents: read + pages: write + id-token: write + +jobs: + + test: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup Node 18 + uses: actions/setup-node@v3 + with: + node-version: '18.x' + cache: 'yarn' + + - name: Install Node dependencies + run: yarn --frozen-lockfile + + - name: Run tests + run: yarn test + + publish: + if: github.ref == 'refs/heads/feat/sb' + needs: [test] + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup Node 18 + uses: actions/setup-node@v3 + with: + node-version: '18.x' + cache: 'yarn' + + - name: Install Node dependencies + run: yarn --frozen-lockfile + + - name: Build storybook artifacts + run: yarn build:storybook + + - name: Upload storybook artifacts + uses: actions/upload-pages-artifact@v3 + with: + path: storybook-static + + - name: Deploy artifact to Github Pages + uses: actions/deploy-pages@v4 + +