From eda57cd6f4536f6ce349fe319de119bb2586efbf Mon Sep 17 00:00:00 2001 From: Uzhastin-Nikita Date: Fri, 18 Mar 2022 00:51:23 +0300 Subject: [PATCH 1/2] feat: addition auto deploy for storybook --- .github/workflows/ci.yml | 43 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c45c7dc..8641d6b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -174,3 +174,46 @@ jobs: NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_TOKEN: ${{ secrets.GH_TOKEN }} run: npx semantic-release + + deploy: + name: Deploy a new components for storybook + needs: [test-lint, test-build, pre_ci] + timeout-minutes: 5 + if: ${{ github.ref == 'refs/heads/master' }} + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 16 + + - name: Manage cache + uses: actions/cache@v2.1.7 + with: + path: | + ./node_modules + key: ${{ runner.OS }}-build-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('.github/workflows/*.yml') }} + restore-keys: | + ${{ runner.OS }}-build-${{ hashFiles('**/package-lock.json') }} + ${{ runner.OS }}-build + + - name: Prepare token + run: echo "//npm.pkg.github.com/:_authToken=${GH_TOKEN}" >> .npmrc + env: + GH_TOKEN: ${{ secrets.GH_TOKEN }} + + - name: Build project + run: npm run build + + - name: Deploy storybook + run: npm run deploy-storybook + + - name: Semantic release + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ secrets.GH_TOKEN }} + run: npx semantic-release From 8458f17e238f75d43adacec52c2d9c0032587838 Mon Sep 17 00:00:00 2001 From: Uzhastin-Nikita Date: Fri, 18 Mar 2022 01:09:29 +0300 Subject: [PATCH 2/2] refactor: fix names in ci.yml for deploy storybook --- .github/workflows/ci.yml | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8641d6b..4529b87 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -175,8 +175,8 @@ jobs: GH_TOKEN: ${{ secrets.GH_TOKEN }} run: npx semantic-release - deploy: - name: Deploy a new components for storybook + deploy-storybook: + name: Update storybook needs: [test-lint, test-build, pre_ci] timeout-minutes: 5 if: ${{ github.ref == 'refs/heads/master' }} @@ -204,16 +204,8 @@ jobs: env: GH_TOKEN: ${{ secrets.GH_TOKEN }} - - name: Build project - run: npm run build + - name: Build storybook + run: npm run build-storybook - name: Deploy storybook run: npm run deploy-storybook - - - name: Semantic release - env: - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} - NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GH_TOKEN: ${{ secrets.GH_TOKEN }} - run: npx semantic-release