From fae578461970e806ff5dc376792a25be7c3b6c0b Mon Sep 17 00:00:00 2001 From: Gauthier Fiorentino Date: Thu, 21 Mar 2024 13:48:12 +0100 Subject: [PATCH] CI: Extract Storybook deployment to its own workflow --- .github/workflows/CD.yml | 16 +++---------- .github/workflows/deploy-storybook.yml | 32 ++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/deploy-storybook.yml diff --git a/.github/workflows/CD.yml b/.github/workflows/CD.yml index 517d8b7..57429b8 100644 --- a/.github/workflows/CD.yml +++ b/.github/workflows/CD.yml @@ -22,19 +22,9 @@ jobs: artifact-name: "storybook-latest" deploy-page: needs: build-storybook - permissions: - pages: write - id-token: write - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - steps: - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 - with: - artifact_name: "storybook-latest" + uses: ./.github/workflows/deploy-storybook.yml + with: + artifact_name: "storybook-latest" publish-package: needs: build uses: ./.github/workflows/publish-package.yml diff --git a/.github/workflows/deploy-storybook.yml b/.github/workflows/deploy-storybook.yml new file mode 100644 index 0000000..786f9c7 --- /dev/null +++ b/.github/workflows/deploy-storybook.yml @@ -0,0 +1,32 @@ +name: 'Deploy Storybook' + +on: + workflow_call: + inputs: + artifact-name: + description: name of the artifact to deploy + required: true + type: string + workflow_dispatch: + inputs: + artifact-name: + description: name of the artifact to deploy + required: false + type: string + default: "storybook-latest" + +jobs: + deploy-page: + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 + with: + artifact_name: ${{ inputs.artifact-name }}