From 60098dac8a8ae13bb5d1f818a4605cca7d394c2a Mon Sep 17 00:00:00 2001 From: Loxeris <30194187+Loxeris@users.noreply.github.com> Date: Tue, 27 Aug 2024 11:23:57 +0200 Subject: [PATCH 1/2] ci(Storybook): always build documentation --- .github/workflows/deployment.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index ada117c..9ace17f 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -58,7 +58,7 @@ jobs: permissions: id-token: write pages: write - if: ${{ github.event_name == 'push' && github.repository == 'DIRACGrid/diracx-web' && github.ref_name == 'main'}} + if: ${{ github.event_name == 'push' && github.repository == 'DIRACGrid/diracx-web' }} steps: - uses: actions/checkout@v4 @@ -68,10 +68,15 @@ jobs: cache: 'npm' - uses: bitovi/github-actions-storybook-to-github-pages@v1.0.3 + if: ${{ github.ref_name == 'main' }} with: build_command: npm run build-storybook -w @dirac-grid/diracx-web-components path: packages/diracx-web-components/storybook-static checkout: false + + - name: Build documentation + if: ${{ github.ref_name != 'main' }} + run: npm ci && npm run build-storybook -w @dirac-grid/diracx-web-components build-deploy-dev-image: runs-on: ubuntu-latest From 5e2c1ad14f55f1d7eea8b9d14b4803e08fd04307 Mon Sep 17 00:00:00 2001 From: Loxeris <30194187+Loxeris@users.noreply.github.com> Date: Wed, 28 Aug 2024 13:39:06 +0200 Subject: [PATCH 2/2] ci(Storybook): build on push and deploy on new release --- .github/workflows/deployment.yml | 34 +++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 9ace17f..55c9771 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -53,12 +53,12 @@ jobs: NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} run: npx lerna publish from-package --no-push --no-private --yes - build-deploy-storybook-docs: + build-storybook-docs: runs-on: ubuntu-latest permissions: id-token: write pages: write - if: ${{ github.event_name == 'push' && github.repository == 'DIRACGrid/diracx-web' }} + if: ${{ github.event_name != 'push' || github.repository == 'DIRACGrid/diracx-web' }} steps: - uses: actions/checkout@v4 @@ -66,18 +66,30 @@ jobs: with: node-version: 'latest' cache: 'npm' - - - uses: bitovi/github-actions-storybook-to-github-pages@v1.0.3 - if: ${{ github.ref_name == 'main' }} - with: - build_command: npm run build-storybook -w @dirac-grid/diracx-web-components - path: packages/diracx-web-components/storybook-static - checkout: false - + - name: Build documentation - if: ${{ github.ref_name != 'main' }} run: npm ci && npm run build-storybook -w @dirac-grid/diracx-web-components + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: packages/diracx-web-components/storybook-static + + deploy-storybook-docs: + runs-on: ubuntu-latest + permissions: + id-token: write + pages: write + needs: [build-storybook-docs, release-please] + if: needs.release-please.outputs.release_created == 'true' + steps: + - id: deploy + name: Deploy to GitHub Pages + uses: actions/deploy-pages@v4 + with: + token: ${{ github.token }} + + build-deploy-dev-image: runs-on: ubuntu-latest if: ${{ github.event_name != 'push' || github.repository == 'DIRACGrid/diracx-web' }}