From 94e8283c009f0b32b62a3522772e349a2d1b691d Mon Sep 17 00:00:00 2001 From: Koen Vlaswinkel Date: Wed, 19 Feb 2025 11:39:43 +0100 Subject: [PATCH] Add workflow for building and deploying Storybook --- .github/workflows/build-storybook.yml | 57 +++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/build-storybook.yml diff --git a/.github/workflows/build-storybook.yml b/.github/workflows/build-storybook.yml new file mode 100644 index 000000000..3c5e5d070 --- /dev/null +++ b/.github/workflows/build-storybook.yml @@ -0,0 +1,57 @@ +name: Build Storybook + +on: + workflow_dispatch: + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + push: + branches: + - main + +permissions: {} + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: Checkout + uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version-file: extensions/ql-vscode/.nvmrc + + - name: Install dependencies + run: | + cd extensions/ql-vscode + npm ci + shell: bash + + - name: Build Storybook + run: | + cd extensions/ql-vscode + npm run build-storybook + shell: bash + + - name: Upload to GitHub Pages + id: deployment + uses: actions/upload-pages-artifact@v3 + with: + path: extensions/ql-vscode/storybook-static + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + runs-on: ubuntu-latest + permissions: + id-token: write + pages: write + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4